Socialid.connectionStorage
From Social ID Developers
Revision as of 20:08, 12 July 2021 by Gabriel.prado (Talk | contribs)
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({ type: "cookie", sameSite: "None", secure: true });