Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Suppose my ASP app is on the same webserver as the company home page. At the end of the app, there is a link to the home page. I want it so that when they click the link and go to the regular HTML pages, the ASP session ends. How would I go about doing this?
Posted

I looked through MSDN, and couldn't find any examples :(

 

I tried this:

 

<%@ import Namespace="System.Web.SessionState" %>
.
.
.

Sub Page_Unload

Dim oSS as New HttpSessionState

    oSS.Abandon
       
End Sub

 

... but I got an error saying the object is Private. Do you have an example?

Posted

Session.Abandon seems to be working. Just one thing. I put the command in Page_Load. Following that line, I put Response.Write(Session("ID")), and it still output the ID value. Only after a refresh will the ID be "VOID", which is the default in my global.aspa file.

 

Is it safe for me to assume that the session state is only truly abandoned (takes effect) on closing the page, a refresh, an AutoPostBack, or a navigation to another page? In other words, after the page with Session.Abandon is unloaded?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...