Thread: PHPSESSID

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

    Join Date
    Jul 2000
    Location
    Indonesia
    Posts
    87
    Rep Power
    15
    I'm trying to learn about the session things.
    But I get confused in the PHPSESSID

    I make a simple script like this :

    <?

    session_start();
    session_register(username);
    $username="CyberOsc";

    echo $username;
    echo $PHPSESSID;

    session_destroy();

    ?>

    Every time I refresh I got the same PHPSESSID printed on browser.
    Why ????
    I think the PHPSESSID is always different every time you registered a session.

    Tnx a lot in advance !!

    See ya !!

    NB : Where can I find a good site for Session tutorial or session example ???



    ------------------
    CyberOsc
    sphmjf_oscario@gurlmail.com

    ** It's the world of Oscario **
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    From the PHP manual:

    session_destroy
    session_destroy -- Destroys all data registered to a session
    Description

    bool session_destroy(void);

    session_destroy() destroys all of the data associated with the current session.

    This function always returns true.

    Note: This function was added in PHP 4.0.

    ------------------------------------------

    session_destroy() does not destroy the session, it merely removes all data associated with the session. The current session (and hence sessionid) remain.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    15
    another question:

    How can I end a session when I don't need it? it means to $PHPSESSID different.
  6. #4
  7. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    To what purpose? Once the data is destroyed the sessionid is pretty much meaningless. There would be no detriment to begin storing new session variables in the current session.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Indonesia
    Posts
    87
    Rep Power
    15
    So it means that once I start a session, it would never be really destroyed.
    Only the variables in it that are destroyed by issuing session_destroy().

    Is that true ???

    See ya !!
  10. #6
  11. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    Until the session or cookie expire

Similar Threads

  1. PHPSESSID shown in URL on firstload of my site...
    By agatt42 in forum PHP Development
    Replies: 7
    Last Post: March 11th, 2004, 09:10 PM
  2. sessions, hotlinking and phpsessid woes
    By miseria in forum PHP Development
    Replies: 4
    Last Post: December 21st, 2003, 01:42 AM
  3. Security check idea - PHPSESSID
    By james555 in forum PHP Development
    Replies: 2
    Last Post: December 19th, 2002, 04:57 PM
  4. URL rewrite + PHPSESSID?
    By lierduh in forum PHP Development
    Replies: 0
    Last Post: December 18th, 2002, 04:46 AM
  5. Array Issues....Automatic PHPSESSID hidden variable??
    By watcorp in forum PHP Development
    Replies: 0
    Last Post: July 17th, 2002, 03:34 PM

IMN logo majestic logo threadwatch logo seochat tools logo