.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Logout-Without Using Javascript

Posted By: BangaruBabuPureti     Posted Date: May 27, 2010    Points:2   Category :ASP.Net
i Have A requirement Like this
After logging Into a User Account .....we Have Logout option ...After Clicking That We Again Redirected To Login Page....
But I Press Back Button in Web Browser...............I am Logging into My Account..............
Can any One please Suggest me How Should We Restrict This Thing ..............Without Using Javascript

Responses
Author: Suresh             
Posted Date: May 27, 2010     Points: 5   

Hello Babu,
Kindly try this code,when u click the logout link buttont, before write this code.\
Session.Clear();
Session.RemoveAll();
Session.Abandon();
Response.Redirect("Login.aspx");

Let me know that, you got correct output.

Author: Sunil Yadav       [Moderator]      
Posted Date: May 27, 2010     Points: 5   

Hi,

Add the following line of code either on InIt or Page load event..

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();


hope it helps.



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend