I have a web application that uses Visual Basic 2008, C#, and the ASP.NET 3.5 Framework. It consists of five pages:
- Index (Index.html)
- About us (AboutUs.html)
- Contact us (ContactUs.html)
- User login (Login.aspx)
- User home (UserHome.aspx)
All pages contain a menu to navigate to all other pages.
Is it possible to clear a session from an HTML page? If a user logs in, navigates to the Contact Us page, then logs out from that page, how can I clear session variables?
No, Sessions are server-side variables and can not be changed in the client-side.
Here are some tips:
behind, in
onLoadMethod put this code:Session["UserId"] = null; Response.Redirect("Index.html",true);