Solved

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

Posted on 2008-10-29
4
715 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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