Re: Can't end session with logout button



Jeff (jeffster86@xxxxxxxxxxx) wrote:
: Thanks, adding the line "<meta http-equiv="pragma" content="no-cache"
: />" worked.

: Micha, I already had the code below at the top of each page, but for
: some reason it wouldn't do the redirect after hitting the "Back"
: button. I'm still not sure why. Just because the page is being read
: from the cache shouldn't mean it should ignore the PHP code at the
: beginning of the page,

But if the page is in the cache then your script is not being called to
display the page. The browser is displaying a previously saved copy of the
html generated by your php script.


: which should have redirected the user to an
: "error" page. I've seen numerous PHP driven web sites that have "log
: off" buttons, and they don't allow the user go see their last page by
: hitting "back" after they've logged off. I wonder if all of these sites
: are using the "no cache" meta tag or some other mechanism? Thanks for
: answering my posts guys.

It should be easy enough to examine their html to find out.


: <?php
: session_start();

: If (!$_SESSION['auth'] == 1)
: {
: header('location:Error.php');
: }
: ?>


--

This space not for rent.
.



Relevant Pages

  • Re: NoAccessAllowed.aspx
    ... Set a low cache time in your page to ensure it does not cache for long on ... > the user clicks the BACK browser button after the session has expired? ... How do you know to redirect them? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Dynamic images
    ... I think we make better use of the client cache though, ... Get all filenames containing [PATH-HASH] in the cache directory ... No) Create a new thumbnail, and redirect to it. ...
    (comp.lang.php)
  • Using require instead of redirect architecture
    ... I've got the redirect example discussed a couple days ago working ... Back, Refresh, 'wrong username' - all work nicely. ... hitting back on p2.php shows the dreaded "The page you are trying to ... second attempt, blah blah blah. ...
    (php.general)
  • Re: Cant end session with logout button
    ... some reason it wouldn't do the redirect after hitting the "Back" ... I've seen numerous PHP driven web sites that have "log ... hitting "back" after they've logged off. ...
    (comp.lang.php)
  • RE: Major Folder Redirection Issues
    ... the offline files cache and database ... You may have to reinitialize the cache. ... "Failed to redirect because the destinaiton ... PROFILES is properly shared as PROFILES$. ...
    (microsoft.public.windows.server.general)