Question : How to create and end a session for a user?

I want to create a session when user logs in and the session should end when he logout.
I have used hyperlink for logout.
When the user logout and if after that he clicks 'back' key of the browser he should not be able to view the previous viewed page as if he is logged in.

Answer : How to create and end a session for a user?

The back button in most browsers bring you back to a cached page, controlled and maintained by the browser.

On the page you want to "expire", try adding the following at the top of the page;

   1. Response.Buffer = True
   2.    Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0))
   3.    Response.Expires = 0
   4.    Response.CacheControl = "no-cache"

This should prevent the browser from caching the page, thus preventing the user from viewing the page by going back.
Random Solutions  
 
programming4us programming4us