Explicitly ending the Session

Results 1 to 2 of 2

Thread: Explicitly ending the Session

  1. #1
    Join Date
    Dec 1969

    Default Explicitly ending the Session

    I need to explicitly end a session so I can have a new sessionID generated without killing the browser or waiting for the session timeout, but after reading up and using Session.Abandon it fails 100% every time. The session is just not ending.<BR><BR>Has anyone had this same problem, is it a configure error on the server end? What can I do to end the session?<BR><BR>The site is being hosted on a commercial NT server so I dont have access to control panel etc.<BR><BR>Thanks in advance.

  2. #2
    peterjl@atlantech.com.au Guest

    Default RE: Explicitly ending the Session

    What you say seems to be true. Session.Abandon seems to do nothing. <BR><BR>What I do is:<BR><BR>&#060;%<BR> Dim Item<BR><BR> Response.Write session.SessionID<BR> for each item in session.Contents<BR> Session(Item) = ""<BR> next<BR>%&#062;<BR><BR>This doesn&#039t destroy the session, but it does clear out any session vars that may exist. I can then test for the existence of a session by querying my user defined session var. <BR><BR>For insatnce if I am tracking a user via session and he hits the logout button, I use the above code to "forget" about him. The next time someone accesses a page and Session("UserName") = "", I send them to the logon page before they can proceed. Session("UserName") can only be non-blank if they are currently logged on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts