473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Preventing Page Review after Logout with Forms Authentication

hello all...I have an issue with my ASP.net pages, suppose you have logged into a site using your username and password. On correct username and password you are re-directed to the appropriate page. Then if you click your browser's backward navigation button then the login page is shown (where you entered your username and password) and then if you click the browser's forward navigation button then you are re-directed to the page without again asking for the username and password. How can this problem be solved in ASP.net 2005 using C#....I have gone through this article but couldnt resolve...

http://aspalliance.com/694_Preventing_Page_Review_after_Logout_with_Forms _Authentication.all
....Please reply me soon...
Nov 13 '08 #1
4 4866
Plater
7,872 Expert 4TB
That is the correct functionality.

Now, if the user was LOGGED OUT (which hitting the back button should not do unless you program that page to log a user out) then there would be an issue.

You should look at setting your pages to be not Cached, and verify that the user is authenticated on each page load
Nov 13 '08 #2
hello thks for reply...I know not to cache the page...but please put ur answer in detailed way.....I just want how the yahoo mail page works when a user logs out and then hitting the browser back button.......still takes to the login page OR..when the user logs in and hits the back browser button(goes to login page) and then forward button(trying to get the secured page)...yahoo takes the user to login page...plz reply me..
Nov 14 '08 #3
PRR
750 Expert 512MB
As far as i know ... this happens becoz the page is cached on the "client side".. so the browser displays the page.. as soon as user click on any server control he will have to "login" again.. ...
the simplest way is to disable back button ( rather make the back button go forward..though i wont recommend this )
Heres a javascript for it
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. javascript:window.history.forward(1);
  3. </script>
  4.  
  5. //or better way
  6.  
  7. <%
  8. Response.CacheControl = "no-cache"
  9.   Response.AddHeader "Pragma", "no-cache"
  10. %>
  11. //C#
  12. Response.Cache.SetCacheability(HttpCacheability.NoCache);
  13.  
  14.  
Check this Microsoft support
Nov 14 '08 #4
Plater
7,872 Expert 4TB
On every page load of the "login" page, make the user be logged out.

On every protected page, have the page be not cached, and at page load check for credentials (if no credentials, redirect to that login page)
Nov 14 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tuan | last post by:
Hi, I am writting a small web application and I want to create a logout page for the users like the logout on yahoo. If the users logout they cannot go back by using back button history on the...
2
by: Vinod I | last post by:
Hi Team, I would like to know how "Logout" can be handled in asp.net page. Scenario is like this:- I have a "logout" option in my menu. As soon as user clicks this, will show a "Sucessfully...
2
by: Judy Ward | last post by:
I need to implement a login/logout feature (for a school assignment). I am using forms authentication. I have an index.html with frames: "top", "side", "main", "bottom". The top frame has a...
2
by: Dr. Paul Caesar - CoullByte (UK) Limited | last post by:
Hi, I have created a Logout ASP.NET application using Forms Authentication. When a user logs out they get a confirmation page confirming logout and a button to click to return to the homepage....
6
by: Kevin Yu | last post by:
is it possible to for user to click a logout button to logout and when the user want to get into the system again, the user have to login again? Kevin
10
by: et | last post by:
I have an asp.net program that uses a connection string, using integrated security to connect to a sql database. It runs fine on one server, but the other server gives me the error that "Login...
2
by: Jeff | last post by:
hey asp.net 2.0 I've placed a LoginStatus control on a master page (so I don't need to have it on every webpage) in my project. When I click on this control to logout, I get this error: A...
2
by: =?ISO-8859-1?B?UOVsIEEu?= | last post by:
Have a "standard" asp.net web solution which uses the standard asp.net authentication and authorization methods (forms authentication). Some users have raised concern that even if you logout...
5
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a site which I secure with forms authentication. When the user's sign on and hit one of the secure pages, I have this line in my code to ensure that the browser does not cache the page;...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.