473,385 Members | 1,824 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,385 software developers and data experts.

How to restrict the user to login by browser back button even after log out in

I am working on web application. I am facing a problem that when logout from my website i was redirected to my login page but when i click on back button of browser i was again able to access my web pages that should be visible after login. Please help me its very urgent
Sep 7 '10 #1
1 1299
MrMancunian
569 Expert 512MB
I usually don't give out code this easily, but I'm in a good mood ;-)

Add the following code to the click-event of your logoff button.
Expand|Select|Wrap|Line Numbers
  1. Response.Buffer = True
  2. Response.Expires = 0
  3. Response.ExpiresAbsolute = DateTime.Now.AddDays(-1)
  4. Response.CacheControl = "no-cache"
That should do the trick.

Steven
Sep 7 '10 #2

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

Similar topics

2
by: Michael G | last post by:
Can the browser back button or browser caching be turned on or off via php? Thanks, Mike ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----...
5
by: Mr Newbie | last post by:
OK, I have a fairly simple setup where I have an Index of records which are displayed using a datagrid on a page. When you click the link associated with a Row (ArticleID) , this ID is passed to a...
2
by: Liming | last post by:
Hi, I have a multiview (with 10 views inside). Now on View2, I ask the user to uplaod a file and click Save to go to View3 and once they get to view3? If the user hits my "previous" button,...
0
by: neeraj | last post by:
Hi Everybody I have one problem in my asp.net web application. The problem is that I check the date validation in code behind; if user not gives the valid data and press save button then I fire...
5
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each...
1
by: joe | last post by:
Logout question I use a session to store the login information, say Session("Login") = success and use page_load to test the session("Login") success or not say If Session("Login") <success...
7
by: nkodali | last post by:
Hi, I am having a signup.asp page where a user enters his details and clicks on subscribe button. I am doing server side validation to check if the user already exists in the database and then...
3
by: Ian Semmel | last post by:
Is there a way to get the Page_Load event to fire if the user clicks the Back button on the browser rather than clicking a hyperlink ?
4
by: shahidrasul | last post by:
hi in my project when i click on logout anchor it goes to logout page and my code in logout page is if (Session != null) { Session = null; Session.Abandon(); ...
2
by: =?Utf-8?B?SmVmZiBEb25rZXJzZ29lZA==?= | last post by:
I have a registration form that updates a province/state droplist when a country is selected from another droplist. When the user clicks the back button though, the province list goes back to the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?

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.