@sidebase/nuxt-session
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -29,8 +29,8 @@ import * as _nuxt_schema from '@nuxt/schema'; | ||
/** | ||
* Set the session duration in seconds. Once the session expires, a new one with a new id will be created. Set to `null` for infinite sessions | ||
* Set the session duration in seconds. Once the session expires, a new one with a new id will be created. Set to `false` for infinite sessions | ||
* @default 600 | ||
* @example 30 | ||
* @type number | null | ||
* @type number | false | ||
*/ | ||
expiryInSeconds: number | null; | ||
expiryInSeconds: number | false; | ||
/** | ||
@@ -83,9 +83,9 @@ * How many characters the random session id should be long | ||
/** | ||
* Set the domain the session cookie will be receivable by. Setting `domain: null` results in setting the domain the cookie is initially set on. Specifying a domain will allow the domain and all its sub-domains. | ||
* @default null | ||
* Set the domain the session cookie will be receivable by. Setting `domain: false` results in setting the domain the cookie is initially set on. Specifying a domain will allow the domain and all its sub-domains. | ||
* @default false | ||
* @example '.example.com' | ||
* @type string | null | ||
* @type string | false | ||
* @docs https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#define_where_cookies_are_sent | ||
*/ | ||
domain: string | null; | ||
domain: string | false; | ||
/** | ||
@@ -101,2 +101,9 @@ * Whether to pin sessions to the user's IP (i.e. Different IP means a different session) | ||
ipPinning: SessionIpPinningOptions | boolean; | ||
/** | ||
* Force the session identifier cookie to be set on every response. The expiration is reset to the original expiryInSeconds, resetting the expiration countdown. | ||
* @default false | ||
* @example true | ||
* @type boolean | ||
*/ | ||
rolling: boolean; | ||
} | ||
@@ -103,0 +110,0 @@ interface ApiOptions { |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.2.6" | ||
"version": "0.2.7" | ||
} |
@@ -8,3 +8,3 @@ { | ||
"name": "@sidebase/nuxt-session", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"license": "MIT", | ||
@@ -11,0 +11,0 @@ "type": "module", |
@@ -10,3 +10,3 @@ ![logo of nuxt session](./.github/session.png) | ||
[![Follow us on Twitter](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://twitter.com/sidebase_io) | ||
[![Join our Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/9MUHR8WT9B) | ||
[![Join our Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/NDDgQkcv3s) | ||
@@ -95,3 +95,3 @@ > Nuxt session middleware to get a persistent session per app user, e.g., to store data across multiple requests. The nuxt session module provides the `useSession()` composable out of the box and sets up API endpoints to interact with your session to make working with sessions feel like a breeze. | ||
- the clients stay is shorter than the maximum session duration (default: 10 minutes, can be infinite in theory), | ||
- the server does not loose it's data (e.g., due to a broken hard-drive) | ||
- the server does not lose its data (e.g., due to a broken hard-drive) | ||
@@ -191,3 +191,3 @@ We call this "stay" that lasts as long as the above criteria are met a session. | ||
The server-side session also contains it's own meta-data of the form: | ||
The server-side session also contains its own meta-data of the form: | ||
```ts | ||
@@ -228,5 +228,7 @@ declare interface Session { | ||
// The request-domain is strictly used for the cookie, no sub-domains allowed | ||
domain: null, | ||
domain: false, | ||
// Sessions aren't pinned to the user's IP address | ||
ipPinning: false | ||
ipPinning: false, | ||
// Expiration of the sessions are not reset to the original expiryInSeconds on every request | ||
rolling: false | ||
}, | ||
@@ -233,0 +235,0 @@ api: { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
41672
603
321