Problem about Session..

Discussion in 'PHP' started by bartolay13, Dec 9, 2007.

  1. #1
    hello there,

    i got a problem here with $_SESSION

    when i close the browser, the session destroys..
    anyway of not destroying the session even if i restart the computer or atleast when i close the browser??

    Thanks in advance!:)
     
    bartolay13, Dec 9, 2007 IP
  2. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    selling vcc, Dec 9, 2007 IP
  3. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #3
    Sessions are meant to be destroyed when you close your browser that is why it is called a session. Like the above poster said, you can store it in a database.
     
    Kaizoku, Dec 9, 2007 IP
  4. Gawk

    Gawk Peon

    Messages:
    427
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can also write the session data to a cookie for later retreval.
     
    Gawk, Dec 9, 2007 IP
  5. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #5
    i dont like cookies.. ^^,
    anyways thanks sellingvcc
    read this up first..
     
    bartolay13, Dec 10, 2007 IP
  6. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You dont like cookies? Creating a session generates a cookie on the users pc by default :)

    If you want to keep session affinity after the browser is closed the only way it to set a long term cookie and store the data in the database, on disk (other than the standard session directory) or memory
     
    tonybogs, Dec 10, 2007 IP
  7. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #7
    
    session_set_cookie_params(3600);
    ini_set('session.gc_maxlifetime', 3600);
    
    PHP:
    Call this BEFORE session_start();
     
    nico_swd, Dec 10, 2007 IP
  8. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #8
    oh shoot.. i have no choice, ill be dealing with cookies.. ^^
    didnt know that one..

    thanks..
     
    bartolay13, Dec 10, 2007 IP