How to preserve php session variables when there is a glitch in net connection

Discussion in 'PHP' started by vinodxx, May 8, 2009.

  1. #1
    Suppose there is a value is storied in a session variable $_SESSION['record'].
    And internet connection goes and comes again.
    This happens with unreliable ISPs.
    How to preserve the old value of $_SESSION['record'] in the new situation.

    Anybody out there to help me.

    Regards,
    Vinod
     
    vinodxx, May 8, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Session variables should be preserved as long as the session hasn't expired and the user has the same session id. They can leave the site and come back and still have the same session as long as their browser didn't close. A interrupted connection should not destroy a session.

    Are you seeing sessions that are getting destroyed in this manner?
     
    jestep, May 8, 2009 IP
  3. vinodxx

    vinodxx Guest

    Messages:
    292
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes surely.
     
    vinodxx, May 8, 2009 IP
  4. Progg

    Progg Peon

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That's a good question. If the internet drops the session wont be preserved as you're seeing. Cookies would solve this problem but aren't as secure since they're stored client side. If I run into a solution I will PM you
     
    Progg, May 8, 2009 IP
  5. !Unreal

    !Unreal Well-Known Member

    Messages:
    1,671
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    165
    #5
    You would have to use a cookie. An unbreakable session is essentially a cookie lol
     
    !Unreal, May 8, 2009 IP