Solved

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

12 Experts available now in Live!

Get 1:1 Help Now