Session-store the verification code in PHP sesssion, after emptying the local browser cookie, the first refresh page is always unavailable, you must refresh the login page again.

Source: Internet
Author: User
RT, Why?

Reply content:

RT, Why?

First, HTTP is a stateless protocol, and the data generated by your last visit is not remembered at the protocol level. In order to increase the management of user session State only session and Cookie.

Whereas session management relies on storing sess_id in a cookie in the client browser, the cookie value is attached to the cookie field in the HTTP request header when you visit the site's page, The server will not know which session it is after accepting the sess_id in the cookie.

Because session_id was rebuilt, I couldn't find it.

Workaround, verify the code in the cache, and the key corresponds to the user ID.

After clearing the cookie, session_id no More ~

Session->cookie->header, in turn, depends on the first refresh without results, normal

It is clear from the above that the session generation relies on the creation of Coodkie, after you have cleared the cookie, the server does not know who you are. This is a normal thing, the average user is not so smart, first delete the local cookie in the operation of your Web site. If this is the case, you recommend that TA re-login.

  • Related Article

    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.