Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Who creates the JSESSIONID cookie in Spring Security?

In my web application theres the requirement that each locale (accessible under the paths /de_DE/, /en_US/ etc.) respectively has it's own session. I did this by overwriting the session CookieGenerator so that it sets a path for the session cookies, so the browser sends the right session id for the accessed locale.

The problem I have now is that Spring Security changes the session ID after the login and generates a new session cookie somewhere. This cookie doesn't have the path I want it to. Where can I manipulate how Spring generates the session cookie?

like image 505
maxdev Avatar asked Nov 10 '15 11:11

maxdev


People also ask

Who creates Jsessionid cookie?

JSESSIONID cookie is created by web container and send along with response to client.

Who set Jsessionid?

If a Web server is using a cookie for session management it creates and sends JSESSIONID cookie to the client and then the client sends it back to the server in subsequent HTTP requests.

What is Jsessionid in Spring Security?

Spring Security is very mature and widely used security framework for Java based web applications. It works perfectly with minimal configuration and following successful login returns JSESSIONID cookie which allows to re-authenticate client's consecutive calls as long as session doesn't expire.

Where Jsessionid is stored?

Generally session stored in cookies.


1 Answers

Look at SessionManagementFilter as here all session related activities happens with the help of SessionAuthenticationStretegy classes.

like image 152
Imrank Avatar answered Sep 21 '22 08:09

Imrank