类 HeaderSessionIdResolver

java.lang.Object
cn.taketoday.session.HeaderSessionIdResolver
所有已实现的接口:
SessionIdResolver

public class HeaderSessionIdResolver extends Object implements SessionIdResolver
A HeaderSessionIdResolver that uses a header to resolve the session id. Specifically, this implementation will allow specifying a header name using HeaderSessionIdResolver(String). Convenience factory methods for creating instances that use common header names, such as "X-Auth-Token" and "Authentication-Info", are available as well.

When a session is created, the HTTP response will have a response header of the specified name and the value of the session id. For example:

 HTTP/1.1 200 OK
 X-Auth-Token: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
 
The client should now include the session in each request by specifying the same header in their request. For example:
 GET /messages/ HTTP/1.1
 Host: example.com
 X-Auth-Token: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
 
When the session is invalidated, the server will send an HTTP response that has the header name and a blank value. For example:
 HTTP/1.1 200 OK
 X-Auth-Token:
 
从以下版本开始:
2019-10-03 10:56
作者:
Harry Yang
  • 字段详细资料

    • HEADER_X_AUTH_TOKEN

      public static final String HEADER_X_AUTH_TOKEN
      另请参阅:
    • HEADER_AUTHENTICATION_INFO

      public static final String HEADER_AUTHENTICATION_INFO
      另请参阅:
    • headerName

      private final String headerName
  • 构造器详细资料

    • HeaderSessionIdResolver

      public HeaderSessionIdResolver(String headerName)
      The name of the header to obtain the session id from.
      参数:
      headerName - the name of the header to obtain the session id from.
  • 方法详细资料