Geeks Talk

Prepare for your Next Interview




Why logout does not work in ASP.NET

This is a discussion on Why logout does not work in ASP.NET within the ASP.NET forums, part of the Web Development category; Manually session check to enter in a web page in asp.net. It works fine.When logout, works fine. But, after logout , when press browser back button it back to ...


Go Back   Geeks Talk > Web Development > ASP.NET

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-13-2008
Junior Member
 
Join Date: Mar 2008
Location: Bangladesh
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ahsanm is on a distinguished road
Why logout does not work in ASP.NET

Manually session check to enter in a web page in asp.net. It works fine.When logout, works fine. But, after logout , when press browser back button it back to the previous page, session check not work.Why?

code for page_load() with session check:
protected void page_load()
{
if(session["id"]==null)
{
server.Transfer("../Index.aspx");
else
{
// ....
}
}
}

code for logout button:
{
session["id"]=null;
server.Transfer("../Index.aspx");
}
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-14-2008
Junior Member
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
aditi.ptl is on a distinguished road
Re: Why logout does not work in ASP.NET

you have to use javascript for disable back button.
<head runat="server">
<script language="javascript">
history.forward();
</script>

Last edited by aditi.ptl : 03-14-2008 at 11:33 AM.
Reply With Quote
  #3 (permalink)  
Old 03-15-2008
Junior Member
 
Join Date: Mar 2008
Location: India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sandu is on a distinguished road
Re: Why logout does not work in ASP.NET

Add Session.Abandon();
code for logout button:
{
session["id"]=null;
Session.Abandon();
server.Transfer("../Index.aspx");
}
Reply With Quote
Reply

  Geeks Talk > Web Development > ASP.NET


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
How the joins work in SQL savitha_shankar Database General 11 07-15-2008 11:06 AM
Work for an MNC Geek_Guest Career Advice 1 09-03-2007 06:36 AM
Applet doesn't work in IE 7.0 psuresh1982 Java 3 07-20-2007 11:39 AM
I don't have any experience to work. BMP1980 Career Advice 2 03-13-2007 11:04 AM
Whether in Team work blenda Interviews 1 08-29-2006 05:31 AM


All times are GMT -4. The time now is 10:01 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved