Solved

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

Posted on 2008-10-29
4
709 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now