vbFace Posted January 9, 2004 Posted January 9, 2004 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? Quote
sharpcoder Posted January 9, 2004 Posted January 9, 2004 Check out HttpSessionState.Abandon Method. Quote
vbFace Posted January 9, 2004 Author Posted January 9, 2004 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? Quote
Administrators PlausiblyDamp Posted January 9, 2004 Administrators Posted January 9, 2004 Could you not just use Session.Abandon() Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
vbFace Posted January 12, 2004 Author Posted January 12, 2004 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.