open class HttpSessionHandshakeInterceptor : HandshakeInterceptor
An interceptor to copy information from the HTTP session to the "handshake attributes" map to made available viaWebSocketSession#getAttributes().
Copies a subset or all HTTP session attributes and/or the HTTP session id under the key #HTTP_SESSION_ID_ATTR_NAME.
Author
Rossen Stoyanchev
Since
4.0
HttpSessionHandshakeInterceptor()
Default constructor for copying all HTTP session attributes and the HTTP session id. HttpSessionHandshakeInterceptor(attributeNames: MutableCollection<String>)
Constructor for copying specific HTTP session attributes and the HTTP session id. |
static val HTTP_SESSION_ID_ATTR_NAME: String
The name of the attribute under which the HTTP session id is exposed when |
open fun afterHandshake(request: ServerHttpRequest, response: ServerHttpResponse, wsHandler: WebSocketHandler, ex: Exception): Unit |
|
open fun beforeHandshake(request: ServerHttpRequest, response: ServerHttpResponse, wsHandler: WebSocketHandler, attributes: MutableMap<String, Any>): Boolean |
|
open fun getAttributeNames(): MutableCollection<String>
Return the configured attribute names to copy (read-only). |
|
open fun isCopyAllAttributes(): Boolean
Whether to copy all HTTP session attributes. |
|
open fun isCopyHttpSessionId(): Boolean
Whether to copy the HTTP session id to the handshake attributes. |
|
open fun isCreateSession(): Boolean
Whether the HTTP session is allowed to be created. |
|
open fun setCopyAllAttributes(copyAllAttributes: Boolean): Unit
Whether to copy all attributes from the HTTP session. If set to "true", any explicitly configured attribute names are ignored. By default this is set to either "true" or "false" depending on which constructor was used (default or with attribute names respectively). |
|
open fun setCopyHttpSessionId(copyHttpSessionId: Boolean): Unit
Whether the HTTP session id should be copied to the handshake attributes under the key By default this is "true". |
|
open fun setCreateSession(createSession: Boolean): Unit
Whether to allow the HTTP session to be created while accessing it. By default set to |