Thread: Sessions

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    29
    Rep Power
    0
    How do i destory a session? The following is what my logout.php says.

    session_start();
    session_unset();
    session_destroy("sesLogin");
    header("Location: login.php");

    i've tried taking out "sesLogin" and it still doesn't work. Whenever i go to the page where it uses the session variables it can still access them. Do i need to unregister them one by one????? btw, my sessionname is sesLogin.


    also... Why doesn't the following work???


    /*
    if((session_is_registered("login") == false) && (session_is_registered("lastLogin") == false)) {
    header("Location: login.php");
    exit();
    }
    */

    I want to make sure those 2 are registered before allowing the user to even look at the main page.

    Thanks for any help
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    15
    May I ask why you commented it out with /**/? Also try using | | (or) instead of && (and). I am just experimenting my sessions in PHP-4 myself.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    29
    Rep Power
    0
    oops sorry.. Ignore the /* */ i copied it from my file and i commented them out for the time being so i could work on other stuff.

    I use && because i want to make sure that both are being set and not just one. I just don't understand why that is not working.

Similar Threads

  1. Why do sessions dissappear when entering a ssl webpage
    By cuboctahedron in forum PHP Development
    Replies: 3
    Last Post: July 2nd, 2003, 09:43 PM
  2. multipage form: sessions or hidden fields?
    By Ssy in forum PHP Development
    Replies: 7
    Last Post: June 24th, 2003, 11:20 AM
  3. Creating user sessions w/out using sessions
    By marron79 in forum PHP Development
    Replies: 5
    Last Post: September 13th, 2002, 06:16 PM
  4. Membership system using sessions and cookies
    By m0nk3y in forum PHP Development
    Replies: 6
    Last Post: March 26th, 2002, 06:24 PM
  5. Replies: 4
    Last Post: September 16th, 2001, 11:48 AM

IMN logo majestic logo threadwatch logo seochat tools logo