Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   After gmail logs out, cannot go back through browser back button (http://www.velocityreviews.com/forums/t666119-after-gmail-logs-out-cannot-go-back-through-browser-back-button.html)

Author 01-18-2009 05:04 PM

After gmail logs out, cannot go back through browser back button
 
After we log out gmail, if we then click on the back button of our
browser, we cannot go back to our inbox. I've tried both Firefox and
IE, both work nicely like this. How did they achieve this?

In my asp.net web application using forms authentication, one can
still go back through the browser back button after one logs out my
application, although, clicking on anything will still kick the user
out.

How can I also prevent people from going back through the browser back
button after one has logged out, just like gmail?

Thanks a lot.

Author 01-18-2009 06:00 PM

Re: After gmail logs out, cannot go back through browser back button
 
On Jan 18, 12:04*pm, Author <gnewsgr...@gmail.com> wrote:
> After we log out gmail, if we then click on the back button of our
> browser, we cannot go back to our inbox. *I've tried both Firefox and
> IE, both work nicely like this. *How did they achieve this?
>
> In my asp.net web application using forms authentication, one can
> still go back through the browser back button after one logs out my
> application, although, clicking on anything will still kick the user
> out.
>
> How can I also prevent people from going back through the browser back
> button after one has logged out, just like gmail?
>
> Thanks *a lot.


OK, I've tried all kinds of suggestions such as history.forward(1);
onload = "if(history.length>0)history.go(+1);" It just does not work.

Does anyone know of a solution that *really* works, like that of gmail
logout? Thanks.

George 01-19-2009 04:27 AM

Re: After gmail logs out, cannot go back through browser back button
 
Try to add following headers to your page

Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT

Then when you click back button browser will request the page again and it's
up to your code to check if user is not logged in and redirect to login
page.

George.

"Author" <gnewsgroup@gmail.com> wrote in message
news:bd85651d-dff3-474f-95d1-785bc818c34c@r27g2000vbp.googlegroups.com...
> After we log out gmail, if we then click on the back button of our
> browser, we cannot go back to our inbox. I've tried both Firefox and
> IE, both work nicely like this. How did they achieve this?
>
> In my asp.net web application using forms authentication, one can
> still go back through the browser back button after one logs out my
> application, although, clicking on anything will still kick the user
> out.
>
> How can I also prevent people from going back through the browser back
> button after one has logged out, just like gmail?
>
> Thanks a lot.



Author 01-21-2009 09:46 PM

Re: After gmail logs out, cannot go back through browser back button
 
On Jan 18, 11:27*pm, "George" <noem...@comcast.net> wrote:
> Try to add following headers to your page
>
> Cache-Control: no-cache, no-store, max-age=0, must-revalidate
> Pragma: no-cache
> Expires: Fri, 01 Jan 1990 00:00:00 GMT
>
> Then when you click back button browser will request the page again and it's
> up to your code to check if user is not logged in and redirect to login
> page.
>
> George.
>


Thanks. I tried like what you said, but the problem is that it does
not work, either in firefox or in IE. This is my html code (the
relevant part only).

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, max-
age=0, must-revalidate" />
<meta http-equiv="Expires" content="Fri, 01 Jan 1990 00:00:00
GMT" />
</head>
<body>

After I logout, I hit the back button of the browser, and it still
goes back to the page and shows everything I have there, apparently
from the cache and no post-back happens.

No one really knows the gmail logout secret? Is it really a secret in
the first place?

George 01-22-2009 03:15 AM

Re: After gmail logs out, cannot go back through browser back button
 
When I said page headers I meant using
Response.AddHeader and not meta tags.

Sorry for confusion

George.

"Author" <gnewsgroup@gmail.com> wrote in message
news:7da86c48-dfe5-4109-b530-3414ef9f3d7c@v5g2000pre.googlegroups.com...
On Jan 18, 11:27 pm, "George" <noem...@comcast.net> wrote:
> Try to add following headers to your page
>
> Cache-Control: no-cache, no-store, max-age=0, must-revalidate
> Pragma: no-cache
> Expires: Fri, 01 Jan 1990 00:00:00 GMT
>
> Then when you click back button browser will request the page again and
> it's
> up to your code to check if user is not logged in and redirect to login
> page.
>
> George.
>


Thanks. I tried like what you said, but the problem is that it does
not work, either in firefox or in IE. This is my html code (the
relevant part only).

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, max-
age=0, must-revalidate" />
<meta http-equiv="Expires" content="Fri, 01 Jan 1990 00:00:00
GMT" />
</head>
<body>

After I logout, I hit the back button of the browser, and it still
goes back to the page and shows everything I have there, apparently
from the cache and no post-back happens.

No one really knows the gmail logout secret? Is it really a secret in
the first place?


Author 01-22-2009 03:03 PM

Re: After gmail logs out, cannot go back through browser back button
 
On Jan 21, 10:15*pm, "George" <noem...@comcast.net> wrote:
> When I said page headers I meant using
> Response.AddHeader and not *meta tags.
>
> Sorry for confusion
>
> George.


You rocked, George. Thanks a lot. It worked.

George 01-22-2009 03:24 PM

Re: After gmail logs out, cannot go back through browser back button
 
Actually I would advice you to get 2 useful tools.

1. Fiddler. It shows communication between server and IE.
http://www.fiddlertool.com/fiddler/

That is how I found out about headers Gmail sent.

2. Firefox with FireBug.
I can not thank developers of FireBug enough for such useful tool and wish
IE had something close to that.
Very useful if you doing a lot of JavaScript or AJAX.

George.


"Author" <gnewsgroup@gmail.com> wrote in message
news:2e6e2408-ddef-458a-a7a6-d6b266e386a1@i24g2000prf.googlegroups.com...
On Jan 21, 10:15 pm, "George" <noem...@comcast.net> wrote:
> When I said page headers I meant using
> Response.AddHeader and not meta tags.
>
> Sorry for confusion
>
> George.


You rocked, George. Thanks a lot. It worked.



All times are GMT. The time now is 11:31 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.