session.cookie_lifetime
Results 1 to 6 of 6

Thread: session.cookie_lifetime

  1. #1
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    session.cookie_lifetime

    Hi folks,

    I am having a problem with the lifetime of sessions:

    In my htaccess file, I set session.cookie_lifetime to 86400 (24 hours), but the sessions seem to expire after approx. 60 minutes.

    Thing is, they DO 'live' for a while, but not for the time that I set.

    Any advice?

    Thanks,

    Jonathan





  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    26

    RE: session.cookie_lifetime

    It would be helpful if you showed exactly how you set said cookie. Most problems with cookie lifetimes seem to come either because the lifetime is set with quotes around it => lifetime is for this session or because of discrepancies between the browser and server's clocks. This latter is relatively easy to check. Just go running to netscape and look under Edit/Preferences/Privacy and Security/Cookies and then click on the button to view the cookies to find yours.

    Csaba Gabor

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    RE: session.cookie_lifetime

    Let me explain what I'm trying to do...
    I'm trying to create a form which will write to a file and then 'remember' the entries (as the 'value' property of the text field) for the next time the user comes back to the form.

    I did not use cookies directly, but rather a session that registers all the user's initial entries.

    In the php.ini file I set
    php_value session.cookie_lifetime 86400

    Now, this works. The initial entries are called and present when the form is visited after this initial input. BUT... only for approx. 60 minutes... (The session ID changes also, of course, after that time)

    If it didn't work at all I'd say "OK, something with the coding is wrong" But it works... So what happens after 60 minutes?


  4. #4

    RE: session.cookie_lifetime

    What's your server software? If you use IIS, go to the properties for your web, to the home direcotry tab, then to configuration, then application options: you can set your session timeout here (note this is IIS 5. 4 is slightly different).

    I don't believe you need it for apache, as it is handled by the directive you gave it in php.ini... Anyone else confirm/deny this?

    That's all I can think of...

    J.

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    RE: session.cookie_lifetime

    It's an apache...

  6. #6
    Junior Member
    Join Date
    Sep 2008
    Posts
    1
    hello my friend, i had the same question, just go to php.ini and replace the following piece of code :

    session.cookie_lifetime = 0

    with :

    session.cookie_lifetime = "3600" // 1 hour

    Then restart your apache server to take effect!!!

    In my case it has worked, test it and tell me

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •