server:
servlet:
session:
tracking-modes: cookie #设定Session的追踪模式(cookie, url, ssl).
这个设定Session的追踪模式不知道有啥用。
原文档:
7.1.1 Cookies
Session tracking through HTTP cookies is the most used session tracking mechanism and is required to be supported by all servlet containers.
(通过HTTP cookie跟踪会话是最常用的会话跟踪机制并且要求所有servlet容器都支持。)
The container sends a cookie to the client. The client will then return the cookie on each subsequent request to the server, unambiguously associating the request with a session. The standard name of the session tracking cookie must be JSESSIONID.
(容器向客户端发送一个cookie。然后客户端将返回cookie对服务器的每个后续请求,明确地将请求赋予会话。会话跟踪cookie的标准名称必须是JSESSIONID。)
Containers may allow the name of the session tracking cookie to be customized
through container specific configuration.
(容器可以允许自定义会话跟踪cookie的名称通过容器特定的配置。)
All servlet containers must provide an ability to configure whether or not the
container marks the session tracking cookie as HttpOnly. The established
configuration must apply to all contexts for which a context specific configuration has not been established (see SessionCookieConfig javadoc for more details).
(所有servlet容器都必须提供配置的能力,无论是否容器将会话跟踪cookie标记为HttpOnly。建立的配置必须应用于尚未为其建立特定于上下文的配置的所有上下文(详情SessionCookieConfig javadoc)。)
7-62 Java Servlet Specification • April 2013
If a web application configures a custom name for its session tracking cookies, the same custom name will also be used as the name of the URI parameter if the session id is encoded in the URL (provided that URL rewriting has been enabled).
(如果web应用程序为其会话跟踪cookie配置了自定义名称,则如果URL中编码了sessionid(前提是启用了URL重写),同样的自定义名称也将用作URI参数的名称。)
去看源码嘛。
来,我们尝试一下。
你可以体验一下这个过程。
当然了,为了害你,我直接把链接挂出来了。
https://download.oracle.com/otn-pub/jcp/servlet-3.0-fr-oth-JS...