#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Reading, UK
    Posts
    31
    Rep Power
    15
    Ok how do I get around this problem?!

    I'm killing sessions using session_destroy(). This removes all evidence of the session on the server and clear's all the variables in the client's cookie, BUT it doesn't delete the cookie as it only removes the data associated with the session.

    My scripts check for the presence of $PHPSESSID, and if it exists they don't set any variables(this way variables already set don't get accidentally cleared). So if someone logs out of my site (and I perform a destroy) and then they log back in, it shows the same session id, but no variables. Which as you may guess isn't terribly handy.

    Anybody know how I can get around this?

    Thanks.

    -- Nick Gushlow

    [This message has been edited by nickg (edited November 03, 2000).]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Reading, UK
    Posts
    31
    Rep Power
    15
    Solved it! The answer was sooooo simple.

    After checking for the presence of the session I then check for the presence of the session variables. So it goes:

    session_start();
    if (!$PHPSESSID) {
    session_register("x");
    session_register("y");
    session_register("z");
    } else {
    if ((!$x) && (!$y) && (!$z)) {
    session_register("x");
    session_register("y");
    session_register("z");
    }
    $code = $z;
    }

    How easy was that?!

    hope this helps someone.

    -- Nick Gushlow

Similar Threads

  1. URL session handling problem
    By rec3000 in forum PHP Development
    Replies: 6
    Last Post: February 24th, 2009, 08:33 AM
  2. reading existing session, problem
    By buttie in forum Perl Programming
    Replies: 7
    Last Post: August 11th, 2003, 10:26 AM
  3. session start issue!
    By djl in forum PHP Development
    Replies: 0
    Last Post: July 29th, 2003, 01:37 PM
  4. PATH_INFO URL - Search Engine Friendly
    By Coopercentral2 in forum PHP Development
    Replies: 2
    Last Post: April 19th, 2003, 10:44 PM
  5. anonFTP hack?
    By (jp) in forum FTP Help
    Replies: 3
    Last Post: March 10th, 2003, 01:58 PM

IMN logo majestic logo threadwatch logo seochat tools logo