Relationship between cookie and session

  • Last update:May 06, 2021
  • I.Description

    Cookies are a technology that allows the website server to store a small amount of data on the client's hard disk or memory, or to read data from the client's hard disk.

    For the introduction of Session, please refer to the document: Report Session and Application Session.

    II. Difference between cookie mechanism and session mechanism

    Specifically, the Cookie mechanism uses a solution to keep state on the client side, while the Session mechanism uses a solution to keep state on the server side. At the same time, we have also seen that because the server-side state-keeping scheme also needs to save an identity on the client side, the Session mechanism may need to use the Cookie mechanism to achieve the purpose of storing the identity, but actually also having other options.

    III. Difference between cookie expiration and session timeout

    The session timeout is maintained by the server, which is different from cookie expiration. First, sessions are generally based on cookies that reside in memory and are not persistent cookies, so there is no expiration date. Even if the JSESSIONID Cookie is intercepted, and an expiration date is set for it, it is sent out. Browser sessions and server sessions are also different. When the user closes the browser, although the Session and Cookie have disappeared, the Session object saved on the server side will not disappear, nor will the persistent Cookie saved on the hard disk disappear.


    Attachment List


    Theme: Report Features
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy