?
Solved

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

Posted on 2008-10-29
4
Medium Priority
?
725 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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