SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with Login script / session_cache_limiter

    Hi. I have a user management script that is essentially Kevin Yank's script. I added a session_cache_limiter in an attempt to get rid of the annoying "Page has expired" warnings that come up whenever a user clicks on the "BACK" button. It works great, but it has the unintended effect of logging the user out (I guess it just drops the "uid" and "pwd" session variables). At least that's what happens when I put the session_cache_limiter before the session_start. When I put it AFTER the session_start, it doesn't log the user out, but it also doesn't work! That is, it reverts back to the "Page has expired warnings". Can anyone help? Here's a snippet below. Thanks!

    <?php // accesscontrol.php
    include($DOCUMENT_ROOT . "/../includes/common.php");
    include($DOCUMENT_ROOT . "/../includes/db.php");
    //We're trying the following in an effort to fix those annoying "Warning: Page has expired" messages.
    session_cache_limiter('private');
    session_start();
    if(!isset($uid)) {
    ?>
    <html>
    <head>
    etc...

  2. #2
    SitePoint Zealot Nate's Avatar
    Join Date
    Sep 2001
    Location
    BC, Canada
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd recommend reading the PHP manual and the user comments related to this... I don't know what is causing your problem, but someone else may have run into the same problem and found a solution.

    Sessions in the PHP manual!
    NATHAN WRIGHT
    PHP Developer, Simple Station

  3. #3
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Been there, done that. :-) There were similar issues, but nothing that quite seemed to help solve my dilemma. Thanks anyway.

  4. #4
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, I tried replacing 'private' with 'private_no_expire' in the session_cache_limiter and it seems to have worked, though I can't say for sure why.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •