Socialid.connectionStorage
From Social ID Developers
(Difference between revisions)
Ivan.filho (Talk | contribs) (Created page with "== Description == Module to manage the Connection Storage behaviour. There are 4 types you can set the Connection Storage: * none: the Connection ID value will not be stora...") |
(→Example) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 15: | Line 15: | ||
{| | {| | ||
− | ! align="left" width="200px" | | + | ! align="left" width="200px" | storageType |
| width="200px" | optional | | width="200px" | optional | ||
| Define how the Connection ID value will be stored at the browser. (see the description above). Can be "none", "cookie", "localStorage" or "sessionStorage". Default for Safari browser: "cookie". Default for other browsers: "none". | | Define how the Connection ID value will be stored at the browser. (see the description above). Can be "none", "cookie", "localStorage" or "sessionStorage". Default for Safari browser: "cookie". Default for other browsers: "none". | ||
|+ | |+ | ||
− | ! align="left" width="200px" | name | + | ! align="left" width="200px" | storageOptions |
+ | | width="200px" | optional | ||
+ | | A Javascript object containing additional parameters. | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | name | ||
| width="200px" | optional | | width="200px" | optional | ||
| Name of the cookie or the storage item. Default: "sidConnectionId". | | Name of the cookie or the storage item. Default: "sidConnectionId". | ||
|+ | |+ | ||
− | ! align="left" width="200px" | path | + | ! align="left" width="200px" style="padding-left: 20px" | path |
| width="200px" | optional | | width="200px" | optional | ||
| Path where the cookie will be saved. Default: "/". | | Path where the cookie will be saved. Default: "/". | ||
|+ | |+ | ||
− | ! align="left" width="200px" | sameSite | + | ! align="left" width="200px" style="padding-left: 20px" | sameSite |
| width="200px" | optional | | width="200px" | optional | ||
| SameSite behaviour for the cookie. Default: "Lax". | | SameSite behaviour for the cookie. Default: "Lax". | ||
|+ | |+ | ||
− | ! align="left" width="200px" | secure | + | ! align="left" width="200px" style="padding-left: 20px" | secure |
+ | | width="200px" | optional | ||
+ | | If the cookie will be delivered for TLS requests only. Default value based on current page protocol. | ||
+ | |+ | ||
+ | ! align="left" width="200px" style="padding-left: 20px" | expires | ||
| width="200px" | optional | | width="200px" | optional | ||
− | | | + | | The expiration time (in days) of the cookie. Default: null (session expiration). |
|} | |} | ||
== Example == | == Example == | ||
− | socialid.connectionStorage.init({ | + | socialid.connectionStorage.init({ storageType: "cookie", storageOptions: { sameSite: "None", secure: true } }); |
Latest revision as of 00:05, 14 July 2021
Description
Module to manage the Connection Storage behaviour.
There are 4 types you can set the Connection Storage:
- none: the Connection ID value will not be storaged, all the management will be directly did from the server-side.
- cookie: the Connection ID value will be storaged at the browser as a Cookie.
- localStorage: the Connection ID value will be saved as a Local Storage item.
- sessionStorage: the Connection ID value will be saved as a Session Storage item.
To configure this module, use init function passing the desired parameters as listed below.
Parameters
storageType | optional | Define how the Connection ID value will be stored at the browser. (see the description above). Can be "none", "cookie", "localStorage" or "sessionStorage". Default for Safari browser: "cookie". Default for other browsers: "none". | storageOptions | optional | A Javascript object containing additional parameters. | name | optional | Name of the cookie or the storage item. Default: "sidConnectionId". | path | optional | Path where the cookie will be saved. Default: "/". | sameSite | optional | SameSite behaviour for the cookie. Default: "Lax". | secure | optional | If the cookie will be delivered for TLS requests only. Default value based on current page protocol. | expires | optional | The expiration time (in days) of the cookie. Default: null (session expiration). |
---|
Example
socialid.connectionStorage.init({ storageType: "cookie", storageOptions: { sameSite: "None", secure: true } });