What is the way to get cookie and session expiration time?

Source: Internet
Author: User
What is the way to get cookie and session expiration time?


Reply to discussion (solution)

The expiration time of the cookie is the one you specified
The remaining time can be calculated using JS, PHP can only be obtained by adding the auxiliary cookie variable

Session expiration time is 0, no need to consider

Is there any way to view the get or something? The session expiration time is not 0, php.ini inside has the configuration

Yes, there's a configuration in php.ini.
; Lifetime in seconds of cookies or, if 0, until browser is restarted.
; Http://php.net/session.cookie-lifetime
Session.cookie_lifetime = 0

Session.cookie_lifetime = 0 means that the browser closes the session and it expires.

Yes, the session was supposed to shut down the browser.

But the session itself can also set the expiration time ah, session.gc_maxlifetime = 1440 in the case of the browser does not close, continuous 1440s No operation of the session will also expire

More and more far away.

Session.gc_maxlifetime represents the minimum duration of session temporary files, not the expiration time
Session.gc_maxlifetime = 1440
means that the session temporary file can be deleted (but not necessarily deleted) after 1440 seconds of the last visit.
If you stay on a page for 24 minutes without doing anything, logging out of his login is also not an easy one.

Study the

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.