Coexistence of http and https causes session loss

1. Problem description

When using tomcat to deploy an application, both http and https are enabled. When the user first opens https://localhost:8443/ and then switches the protocol to http://localhost:8080/, the system background cannot get the login page Verification code (the verification code generated in the background is stored in the session).
If you do not switch between http and https, you can get the verification code normally without this problem.

Two, cause

The coexistence of http and https causes the session to be lost, and the verification code stored in the session is naturally not available!

Reference :
JSessionID will be overwritten when switching between HTTP and HTTPS. How to solve?

Guess you like

Origin blog.csdn.net/ory001/article/details/110132966