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..

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.