Languages
[Edit]
EN

Tomcat - spring does not create JSESSIONID with http when https was used before

10 points
Created by:
Vadim-Kotiv
414

In this article we want to show how to create new session for http protocol when web browser blocks Set-Cookie with JSESSIONID after https was used.

1. Problem description

Edit

Google Chrome error:

When https protocol is in use, Tomcat creates JSESSIONID cookie with Secure property that makes imposible to create JSESSIONID again with http protocol.

Issue screenshot:

Google Chrome DevTools with blocked JSESSIONID for Tomcat
Google Chrome with blocked JSESSIONID on localhost - Tomcat / DevTools

Response header for http with Secure property:

2. Problem solution

Edit

Simple Steps:

  1. open https://localhost,
  2. go to Application tab in Google Chrome DevTools,
  3. remove JSESSIONID cookie - do not refresh web browser,
  4. go to http://localhost - it will create JSESSIONID without Secure property,
  5. now you can use Tomcat sessions with http again.

3. Advices

Edit
  • do not mix http with https,
  • it is good to add redirection to https if it is possible.

Alternative titles

  1. Tomcat - spring does not create JSESSIONID
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join