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

Warning message in ASP page during back using browser's back button

Hi All,
Please help me, I am trying it from 2 days.
I have a login page in asp that is including other pages using #include.....
after login user in the same page but enters in the database.
I want to disable to call this page using back button after logout. I have used this method:

<%Response.Expires = -1 %>
<%Response.ExpiresAbsolute = Now() - 1 %>
<%Response.AddHeader "pragma", "no-cache" %>
<%Response.AddHeader "cache-control", "private" %>
<%Response.CacheControl = "no-cache" %>
----------------------------------------------------------------------------------------
but for other pages this is working fine but for login page it is not because it is the result of post values.

Please tell me how can i disable the browser to resubmit the information again, because it give a warning message and upon refershing it resumit the information and that page is ready to use to user after log out.

Thanks
Mar 26 '07 #1
3 6074
jhardman
3,406 Expert 2GB
Please tell me how can i disable the browser to resubmit the information again, because it give a warning message and upon refershing it resumit the information and that page is ready to use to user after log out.

Thanks
Ok, this work-around is a little awkward, but it does work. Do you set a user ID in a session-level variable after login?
Expand|Select|Wrap|Line Numbers
  1. session("userID") = request("login")
on the login page, or on the page that handles the login, add a simple line like this right at the top:
Expand|Select|Wrap|Line Numbers
  1. if session("userID") <> "" then
  2.    response.redirect "anotherPage.asp"
  3. end if 
Let me know if this helps.

Jared
Mar 26 '07 #2
Thanks for ue suggestion, but i have already tried this way.it does not work.

understand my problem:

I have a page workhere.asp, that is including another page login.asp, in login.asp, user is entering uid and pwd n posting the values to workhere.asp.
which again calliung login.asp n there is if else condition in login.asp. if user enters write uid n pwd then user gets into database but the page is workhere.asp itself.
thats y i was saying it is the result of post values.
when i click on back button after logout, browser asks to refresh the page n if i refresh the page it sends the uid n pwd to workhere.asp, becoz login.asp has posted those values.

i readout some where that this type of condiotion can not be prevented.but still there must be some solution.
one solution is there to seprate the files.

but i don't want to modify more files.becoz this is a live project.

Regards
Mar 28 '07 #3
jhardman
3,406 Expert 2GB
Thanks for ue suggestion, but i have already tried this way.it does not work.

understand my problem:

I have a page workhere.asp, that is including another page login.asp, in login.asp, user is entering uid and pwd n posting the values to workhere.asp.
which again calliung login.asp n there is if else condition in login.asp. if user enters write uid n pwd then user gets into database but the page is workhere.asp itself.
thats y i was saying it is the result of post values.
when i click on back button after logout, browser asks to refresh the page n if i refresh the page it sends the uid n pwd to workhere.asp, becoz login.asp has posted those values.

i readout some where that this type of condiotion can not be prevented.but still there must be some solution.
one solution is there to seprate the files.

but i don't want to modify more files.becoz this is a live project.

Regards
it doesn't matter if the "back" button posts values again as long as you check for session variables on the log in page before handling the posted form data. I'm serious. You can make the page completely ignore any data posted to it by handling the session variables first, and if they exist, ignore the posted data. This is why you don't re-log in to hotmail, for example, if you hit the "back" button. Do you currently use session-level variables?

Some people like to use a "logout" button. These are becoming fairly standard, so much so that many users will realize they are expected to use them when done with your site, even without prompting. But still, a determined user could push "back" enough times to log in again, unless you check for session variables.

Jared
Mar 28 '07 #4

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

Similar topics

16
by: Dave Smithz | last post by:
Hi, In summary: I want to a form to submit information via a HTTP POST, however, when using Internet Explorer I want to be able to use the back button and all the information retained....
1
by: ddddd | last post by:
Regarding the Internet Explorer message below: "Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
1
by: dave | last post by:
How do you get around the problem of "Warning: Page Expired" when clicking the back button a browser. I have several cases where i have a listing page that then goes to a detail page in the same...
1
by: Tom wilson | last post by:
Yes, I'm sorry, it's me again. :) Yesterday I went through hell trying to figure out why my aspx pages wouldn't maintain state. I had a simple example I (we) eventually got to work. What...
1
by: tshad | last post by:
This is driving us crazy. And it only seems to happen in IE. Mozilla and Firefox don't have this problem. We get this message all the time, but I can't figure out why as it is not consistant...
3
by: laryten | last post by:
Hi, Is there a way to update the same web page instead of getting a new page each time we click the submit button? The simplest thing to do is to delete the current page (or go back to the...
8
by: Harvey Schmidlapp | last post by:
I have a fairly complex form (generated by means of an ASP 3 page). The form is used to define a query against a database. After running a query, the user hits their browser's back button and goes...
1
by: swatiminiyar | last post by:
Hi all, I am getting a problem of Page expiration in IE .I have searched a lot on web.I got many results but not able to resolve my problem. I have a a form where i will write a article.I will...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.