hello guys..!!
i m having problem with logout code in asp.net with c#. this logout code should end session, disable browser's back button and and if somebody try to login by paste the url of any user account page, he can't.
plzzz help
thank you in advance..

7 Years
Discussion Span
Last Post by Ramesh S

Use Session.Abandon() method in the logout button. Once the Abandon method is called, the current session is no longer valid and a new session can be started.

If you do not want to other users access the pages without login to system, you need to check the whether the user login details are stored in the Session in page load event of every page. For that, declare a base Page class and inherit all your pages from that base page except login page. In load event of the base Page class check if log-in details are stored in the session. If yes, allow to view the page otherwise redirect to login page.

You can also use Forms Authentication.

FormsAuthentication.SignOut Method will logout the current session and redirects to login page.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.