Kill all Sessions

Results 1 to 2 of 2

Thread: Kill all Sessions

  1. #1
    Join Date
    Dec 1969

    Default Kill all Sessions

    Is there a way to kill all sessions through programming?<BR>Basically, at certain points we want to kill all sessions active on our .net website. <BR><BR><BR><BR>T

  2. #2
    Join Date
    Dec 1969

    Default You mean...

    The actions of one user would trigger the abandonment of the sessions of all users? Or do you mean that you may want to abandon all user sessions because of some maintenance issue not related to any specific user activity?<BR><BR>Brute Force Method<BR>Restart the web service. If you are using, this is as simple as making a small change to the web.config file.<BR><BR>Alternate Method<BR>One user would have to set some type of global flag like <BR>Application("LastSessionRestart") = Date.Now()<BR>This should be set in global.asax in the Application_Start() sub<BR><BR>You would also set<BR>Session("LastSessionRestart") = Application("LastSessionRestart")<BR>in global.asax in the Session_Start() Sub<BR><BR>In the code, you would have to check on every page<BR>If Session("LastSessionRestart") &#060;&#062; Application("LastSessionRestart") Then<BR> Session.Abandon<BR> Session("LastSessionRestart") = Application("LastSessionRestart")<BR>End If<BR><BR>Then, whenever you want to reset everyone&#039;s session, just reset the Application variable<BR><BR>Make sense?

Posting Permissions

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