Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 31, 2011 05:04 PM by sachingusain
Jan 30, 2011 08:42 AM|LINK
how to check session every time.
Jan 30, 2011 12:55 PM|LINK
You can check like:
//There is a session key named varName
Jan 31, 2011 04:54 AM|LINK
Could you please be more specifc what you want to check with respect to Session object?
Jan 31, 2011 05:21 AM|LINK
for checking session, you should first assign/create a session,
eg:On the click of the login button, a session should start and is written as : Session["name"] = "username";
now you can use Session["name"] throughout the application to check whether the user's session is active or not.
if(Session["name"] = "anyTextUwant")
It is recommended that you Abandon a Session once the user clicks on the Logout
Hope this is what you were looking for,
Jan 31, 2011 05:35 AM|LINK
If i understood your question correctly, you want to check for session availability on every page in your applicaiton.
This can be achieved by having a BasePage in your solution and all pages in website being inherited from that one.
1/ In the BasePage override OnInit method
//redirect user to login page.
2/ Configure in web.config Form Authentication to redirect page on timeout.
Jan 31, 2011 05:36 AM|LINK
This may help you .....just check it....
Jan 31, 2011 05:04 PM|LINK
Look at this video for explanation on session object: