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 ()