Session Variable Life?

Discussion in 'Programming' started by Rahul Bose, Jul 10, 2010.

  1. #1
    Hi,

    I am loading my php script's session variables with values before re-directing the user to a 3rd party payment processing page. When payment is complete the user is then directed back to my script where a success message is printed. I then want to access the session variable but they appear to be empty.

    I thought that the session remianed live until the browser window is closed, is this not correct?

    Thanks in advance,
     
    Rahul Bose, Jul 10, 2010 IP
  2. Media ( ID )

    Media ( ID ) Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why not use cookies ? They'll live as long as you need - hours, days, weeks .. years.
     
    Media ( ID ), Jul 11, 2010 IP
  3. Asdff1818

    Asdff1818 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I program in ASP.NET, but I am guessing that this is the same in PHP.
    A session lives until someone closes the browser window, or when the time limit that you have set is reached.
    As someone else said, you could use cookies, but they are less secure, but if security is not a problem, then you should probably try cookies, they are faster also.
     
    Asdff1818, Jul 11, 2010 IP