Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 4 of 4

This is a discussion on Cant open a new session in the Shared & Semi-Dedicated forum
I am trying to close and destroy the current session and open a new one but it wont give the client a new session id. ...

  1. #1
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225

    Cant open a new session

    I am trying to close and destroy the current session and open a new one but it wont give the client a new session id.


    session_destroy();

    session_id(md5(uniqid(rand(),true)).time ());


    I have also tried it by redirecting to the front page again without trying to set a session on this page. It just never sets a new one unless I close the browser and open a new one.



    Mike
    Parks Web Creation
    http://www.parkswc.com

    Professional web design and computer services at a reasonable price

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by Michael
    I am trying to close and destroy the current session and open a new one but it wont give the client a new session id.


    session_destroy();

    session_id(md5(uniqid(rand(),true)).time ());


    I have also tried it by redirecting to the front page again without trying to set a session on this page. It just never sets a new one unless I close the browser and open a new one.



    Mike
    I dunno... Try:
    Code:
    session_id(md5(uniqid(rand(),true)).time());
    
    session_unset();
    
    session_destroy();
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    Senior Member Michael's Avatar
    Join Date
    Jan 2002
    Location
    PA
    Posts
    225
    Thanks for the help.
    I think I have figured this out.

    The session cookie was not being cleared.
    I used,

    if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), '', time()-42000, '/');
    }

    session_destroy();

    and then forwarded it back to a the front page where a new session is made, it works.

    Mike
    Parks Web Creation
    http://www.parkswc.com

    Professional web design and computer services at a reasonable price

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Cool!

    I was just guessing, based on my experience with other things. It's almost always better to clean up things after a function/call/whatever, rather than before.

    LoL! How's that for a grossly over-generalized observation?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

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
  •