Results 1 to 2 of 2

Thread: Logout...

  1. #1
    Join Date
    Dec 1969

    Default Logout...

    I am using session object to make sure the user is logged in or not. After user logs in I need to provide the user funcionality to logout. In asp session only timesout or dies when you close the browser. How can I explicitly end the session and not close the browser or should I use great javascript and just close the browser when user clicks on logout, hence session dies...<BR><BR>thanks<BR>g

  2. #2
    Duc Guest

    Default RE: Logout...

    You mean something like this???<BR><BR>Session.Abandon<BR><BR> <BR><BR>Remarks<BR>When the Abandon method is called, the current Session object is queued for deletion, but is not actually deleted until all of the script commands on the current page have been processed. This means that you can access variables stored in the Session object on the same page as the call to Abandon, but not in any subsequent Web pages.<BR><BR>For example, in the following script, the third line prints the value Mary. This is because the Session object is not destroyed until the server has finished processing the script. <BR><BR>&#060;%<BR> Session.Abandon <BR> Session("MyName") = "Mary"<BR> Reponse.Write(Session("MyName"))<BR>%&#062;<BR> <BR>If you access the variable MyName on a subsequent Web page, it is empty. This is because MyName was destroyed with previous Session object when the page containing the above example finished processing. <BR><BR>The server creates a new Session object when you open a subsequent Web page after abandoning a session. You can store variables and objects in this new Session object. <BR><BR>Example<BR>The following example causes the session state to be released when the server finishes processing the current page.<BR><BR>&#060;% Session.Abandon %&#062;<BR> <BR>Good Luck<BR>Duc

Posting Permissions

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