Solved

Implementing signout feature in asp.net2.0  without using built in login controls

Posted on 2008-10-29
4
711 Views
Last Modified: 2013-12-17
Hi all,
I am Implementing signout function on a website in asp.net 2.0 without the use of built in Login controls.

I am using a link button for signout
In the button click event I am setting the session["User"] = null;
and redirecting it to sites home page say home.aspx.
But now when I click on browsers back button I am able to see the features of the page from which I signed out.
The page content is probably coming from browser case or.....
I do not want this to happen.
I mean I do not want a user to see the pages , which he can see only a fter signing in ,after logout and clicking Browsers back button.
Please help
0
Comment
Question by:dhiraj79
  • 2
4 Comments
 
LVL 9

Expert Comment

by:gdupadhyay
ID: 22832552
I think you are looking for this:

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23052591.html
Please let me know, if you are not looking for this one.
0
 
LVL 9

Accepted Solution

by:
gdupadhyay earned 500 total points
ID: 22832710
I have checked above article on my local PC. Its working fine. Just read the accepted solution of pessanha.
You need to add following on your page load event.

Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ExpiresAbsolute = DateTime.Now.AddMonths(-1);

That's it. No need to do more.

Please let me know if you have any question.

Thanks
0
 
LVL 7

Expert Comment

by:ASPSQLServerCOM
ID: 22833649
couple of other method

http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911

**********************
http://www.4guysfromrolla.com/webtech/111500-1.shtml
You can also use client-side code to force the user's browser to not cache a Web page.

<html>
<head>
  <meta http-equiv="Expires" CONTENT="0">
  <meta http-equiv="Cache-Control" CONTENT="no-cache">
  <meta http-equiv="Pragma" CONTENT="no-cache">
</head>

There are a couple things to keep in mind when using the above method to force a browser to not cache a Web page:

Pragma: no-cache prevents caching only when used over a secure connection. A Pragma: no-cache META tag is treated identically to Expires: -1 if used in a non-secure page. The page will be cached but marked as immediately expired.

Cache-Control META HTTP-EQUIV tags are ignored and have no effect in Internet Explorer versions 4 or 5.
**********************************
http://www.4guysfromrolla.com/webtech/111500-1.2.shtml
adding client-side JavaScript code on the page that we do not want to let the user return to. Such JavaScript code could be used to have the effect of hitting the forward button, which would counter any action by a user clicking the back button. The JavaScript code to accomplish this can be seen below:

<script language="JavaScript">
<!--
  javascript:window.history.forward(1);
//-->
</script>
0
 

Author Closing Comment

by:dhiraj79
ID: 31511227
Thnks gdupadhyay! Its working
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question