A session transport that adds the Set-Cookie header and reads the Cookie header for the specified cookie name, and a specific cookie configuration after applying/un-applying the specified transforms defined by transformers.
Configures Sessions to pass a session identifier in cookies using the nameSet-Cookie attribute and store the serialized session's data in the server storage. The block parameter allows you to configure additional cookie settings, for example:
Configures Sessions to pass a session identifier in a name HTTP header and store the serialized session's data in the server storage. The block parameter allows you to configure additional settings, for example, sign and encrypt session data.
Un-applies a list of session transformations to a cookieValue representing a transformed session string. If any of the unapplication of transformations fail returning a null, this function also returns null.
Cookie time to live duration or null for session cookies. Session cookies are client-driven. For example, a web browser usually removes session cookies at browser or window close unless the session is restored.
Returns a sessionId for for a single session identified by ID. This will not work if there are multiple sessions by ID were registered or the Sessions plugin is not installed. If you are using multiple sessions, please use sessionId function instead.
A plugin that provides a mechanism to persist data between different HTTP requests. Typical use cases include storing a logged-in user's ID, the contents of a shopping basket, or keeping user preferences on the client. In Ktor, you can implement sessions by using cookies or custom headers, choose whether to store session data on the server or pass it to the client, sign and encrypt session data and more.