Why do I realize long-term logon after I log on to Douyu website?

Source: Internet
Author: User
The login status on Douyu website can be maintained for one week. If SESSION + COOKIE is used, what is the login status? Is it a pure COOKIE? The login status on Douyu website can be maintained for one week. If SESSION + COOKIE is used, what is the login status? Is it a pure COOKIE?

Reply content:

The login status on Douyu website can be maintained for one week. If SESSION + COOKIE is used, what is the login status? Is it a pure COOKIE?

Currently, it is quite popular to save the session id in the cookie and the session status on the server (for example, in redis, the key is the session id)

For websites with few visits, you can use session to add cookies. you can configure PHP. ini to set the Expiration Time (
Session. cookie_lifetime, session. gc_maxlifetime) is greater than one week.
The session is stored in the database, and it is convenient to access redis.

When logging on, save the session, such as your ID and user name, and set the validity period. when you perform another operation, if the session contains a matched ID and user name within the validity period, directly log on to the system.

For more information, see localStorage and sessionStorage.

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.