Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post

    session id in a long life cookie

    Okay, my session's cookie is by default set to destroy on session closure. I want to make this cookie last 30 days. the only way I came up with is to put:

    session_set_cookie_params()

    before every time I say session_start(). Is there an easier way to do this? something that I can do only once?

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,027
    Thanks
    2
    Thanked 315 Times in 307 Posts
    session.cookie_lifetime can also be set in php.ini or a .htaccess file.

    The session cookie lifetime is only one part of how long a session is kept. The session garbage collection settings control the lifetime of the session data file on the server.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    okay, that answered enough of my questions. Thanks alot.


  •  

    Posting Permissions

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