quastion about variable and sessions

Discussion in 'PHP' started by vipvanlines, Nov 20, 2006.

  1. #1
    hello guys, im little new with php i wish some1 can help me with that problem please.

    when some1 login to my system, i save variables in the session.
    always when they dont use the page for like 20+- minutes the variables removed from the session,
    can some1 tell me please how to make it longer please

    realy thnks guys

    liran
     
    vipvanlines, Nov 20, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. vipvanlines

    vipvanlines Peon

    Messages:
    171
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thank you,
     
    vipvanlines, Nov 20, 2006 IP
  4. crazybjörn

    crazybjörn Peon

    Messages:
    270
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That is the point of sessions though, they are supposed to time out without user activity. It's one of the reasons why someone would use sessions instead of cookies.
     
    crazybjörn, Nov 20, 2006 IP
  5. skylark

    skylark Guest

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I agree with crazybjörn, I think cookies might be what you need to implement. You're half way there seeing that you're storing the variable values in seesion vars. Now. all you'll need to do is store them in cookies instead.
     
    skylark, Nov 20, 2006 IP
  6. LouisR

    LouisR Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Try adding this to your code:
    in_set('session.gc_maxlifetime','3600');
    Code (markup):
    The default is 1440 seconds, or 24 minutes. 3600 will be 1 hour.
     
    LouisR, Nov 20, 2006 IP