Previous Next

Thread: Starting a new session

Last post 04-18-2008 1:32 PM by tsllbn. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 04-17-2008, 2:10 PM

    • SamHills
    • Not Ranked
    • Joined on 04-17-2008, 6:03 PM
    • Posts 1

    Starting a new session

    The login page in my web-based app. executes Session.Contents.RemoveAll() and Session.Abandon prior to displaying the login screen to make sure any session variables set by a prior user are completely wiped out before logging the new user in.  However, the Session_OnStart event has already fired, and the Session_OnStart code in global.asa has already executed.

     Is there any way of re-executing the Session_OnStart code in global.asa to re-initialize the variables it creates, after wiping out the existing session variables?  I don't want to have to put the same code in two different places (global.asa and login.asp).

     I'm running classic asp, not .net.
     

  • 04-18-2008, 1:32 PM In reply to

    • tsllbn
    • Not Ranked
    • Joined on 05-24-2007, 7:22 AM
    • Posts 4

    Re: Starting a new session

    The problem is session won't be actually abandoned until the page you called the abandone method of the session object, finishes executing. And once the session gets abandoned, IIS will only create a new session when the user requests a new page. So you can't abandon and create a session in the same page.
Page 1 of 1 (2 items)
Page view counter