How tomcat server identifies clients to create session id

I need to find out how the tomcat server identifies different hosts to create unique sessions. Does it do it according to Ip?

Based on the answer to this question, I want to be able to create multiple sessions for a single client on the server that just uses httpServletRequest.getSession()

to create new sessions. Is it possible to provide a predefined session ID to a server so that this server creates this new session associated with this session ID?

+3


source to share


2 answers


It does not perform identification. Every time a request comes in and you ask to create a session, it creates one. The generated session ID is sent to the browser in a cookie, and the browser sends that cookie for all subsequent requests, allowing Tomcat to find the associated session.



I cannot figure out what you are trying to achieve. The session does not identify the server. It identifies a specific client of the web application. Each client has its own session ID. Assigning a session ID to the server doesn't make a lot of sense to me.

+4


source


It turns out that if you don't have a cookie, you are treated like a brand new user and he gives you a new cookie. So not sending the cookie is enough to get another session ID.



0


source







All Articles