Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the mechanism of tomcat session generation?

Shulou Source: shulou.com Published: 2022-06-02 07:27:40 10月03日 Update

This article introduces the relevant knowledge of "what is the tomcat session generation mechanism". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The tomcat underlying maintains a ConcurrentHashMap whose key is jessionId and its value is session

After initiating a request from a browser, tomcat will first parse the request header to see if there is a cookie with the corresponding name (JessionId). In some cases, it will look for session based on this cookie value. If it is not found, it will be created, and the session will be returned if it is not found. This leads to the same sessionId if the same browser logs in to two accounts without special treatment.

Solution: clear the cookie value of jessionId when requesting background

Do not use the default session generation mechanism of tomcat

This is the end of the content of "what is the mechanism of tomcat session generation". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Mechanism generation content more browser knowledge browsing practical special learned next name background dilemma actual underlying situation article method case Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Tech Info OPPO Reno Linux Microsoft