Logout and Session Expire methods in Asp.net
I am working on an application where using a page for login.
1.How to write code for Logout button?
2. If user does not perform any action within 10 minutes then the session should expire and ask user to re-login for any action.
3. How I can disable Back and next buttons in the explorer?
4. How to disable right click menu on the page?
Thanks In advance
[400 byte] By [
mejaz] at [2007-11-20 9:34:30]

# 1 Re: Logout and Session Expire methods in Asp.net
1 & 2. Take a look at Session object in MSDN. You will have to set the Expiry for the session and abandon it once the Logout button is clicked.
3. Not a good Idea. However, you need Javascript for that. A search here will give you your answers
4. Again Javascript. A search again will give you your answers.
# 2 Re: Logout and Session Expire methods in Asp.net
Thanks shuja.
I have One more question about the logut and next button in browser.
Once the user logged out the login screen will appear but what about if user click on next button will it allow user to go to the next screen or is there any way to check the login?
Thanks in advance
mejaz at 2007-11-9 11:54:35 >

# 3 Re: Logout and Session Expire methods in Asp.net
Thanks shuja.
I have One more question about the logut and next button in browser.
Once the user logged out the login screen will appear but what about if user click on next button will it allow user to go to the next screen or is there any way to check the login?
Thanks in advance
Why don't you try that out yourself. Once the session is abandoned, the user cannot access any of the pages unless s/he logs in. Assuming that you have written code for implementing Form's Authentication in your ASP.NET application.
# 4 Re: Logout and Session Expire methods in Asp.net
Hi this is bhaskar
the best thing is to clear session is ...
Session.Clear()
Session.RemoveAll()
Session.Abondon()
with in these three write above two lines of code in logout button onClick event.
hope it will work out for you..