Create new session during window.open

Discussion in 'PHP' started by sonirajesh, Jul 4, 2007.

  1. #1
    Any one have idea on how to force the server to create a new session for child window instead of joining the existing session?

    ie i want different SESSION should run in both parent & child window. moreover i donot want to destroy parent session.

    Thanks
    __________________
    Rajesh Soni
     
    sonirajesh, Jul 4, 2007 IP
  2. bibel

    bibel Active Member

    Messages:
    289
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #2
    That can not be done. You will have the same session for a domain in the new window as in the old one.
     
    bibel, Jul 4, 2007 IP
    JEET likes this.
  3. Greg Carnegie

    Greg Carnegie Peon

    Messages:
    385
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It depends what you mean by child session?

    You can create another field in your session like:
    $_SESSION['child'] and keep there new session data.

    When PHP will check for session data you can make condition
    
    if(@$_SESSION['child'])
    {
        // use child session data
    } else {
        // use old data
    }
    
    PHP:
    You actually can't create new session without destroying old session but you can "pretend" that there is a new session.
     
    Greg Carnegie, Jul 5, 2007 IP
    JEET likes this.
  4. SUSH

    SUSH Peon

    Messages:
    28
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Take a look at the php website where they explained sessions. Under user "notes" someone did mention something like this, and they also posted a code. Not sure though...
    If you could tell us what you need to do, may be we can suggest some alternative or something.
    Bye :)
     
    SUSH, Jul 5, 2007 IP
    JEET likes this.