Hi ..

i have a login page which performs some operation and finally when i log-out that page it has close all the session and navigate to the home page , but then when i click back button in IE it should not post back the page again..

thanks in advance

Call the Session.Clear() method when the log out code is complete (but before the redirect to the home page). This will clear out all session values regardless of whether the back button is clicked - as long as each page checks for an active session anyway.

hi .

can give me an example..because i have cleared the session before transferring my page ..but then when I click the back button it shows the data..

Thanks ...

Does the page you go back to check to see if a valid session is active?
In the page load part of the page check for whatever session variable shows the user is logged in. If it exists or is set to the correct value continue to load the page. If not then redirect to the home page or login screen. Once you have cleared the session this page won't display even by pushing the back button

hi hericles,

its working :-) Thank you...

Hi ,

You can do this very easily.Just use session.clear() method and redirect to login page.

From
websoftcreation,jaipur

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.