Session.invalidate ()

Source: Internet
Author: User


When the browser first requests, the server creates a Session object, generates a SessionID, and in this response sends the SessionID back to the client browser memory in response to the message, or to the client in the form of a rewrite URL, to maintain the entire session. When you close this browser window, its in-memory SessionID is destroyed.


Session.invalidate () is the session is set to fail, generally used at the exit, but note that: the session is invalid while the browser will immediately create a new session, your first session has been invalidated So the GetAttribute method that calls it must throw NullPointerException


Jsessionid only the name of the session ID in Tomcat, in other containers, is not necessarily called Jsessionid.


Secondly, when you are programming, you can add a cookie or use a session, both of which will produce a cookie cookie. Name Jsessionid should be you use session programming, it will be recorded in the window of the temporary cookie placed in memory You can get this cookie and use it as long as you don't turn it off in the window, but once you turn off the window, the cookie disappears.

This article is from the "Nothing-skywalker" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1665538

Session.invalidate ()

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.