session property

Session? session
getter/setter pair

The session associated with the context or null.

If the HTTP request indicated that it belongs to a session (either by presenting a session cookie or URI parameter) the session will be automatically retrieved and this member set to it. That is, if the session has not been terminated or has expired. If there is no session, this will be set to null.

The request handler can set this member to a non-null value. That will cause the session to be indicated in the HTTP response (either by setting a session cookie or rewriting URLs).

The request handler can also set this member to null to make the browser no longer identify future requests as belonging to a session. For example, if a session cookie was presented in the HTTP request, it will be deleted by the HTTP response.

Note: sessions should be set/cleared before calling rewriteURL.

Implementation

Session? session;