createSession()
The createSession
function returns from Amee, used to create the user session.
Syntax
Parameters
The callback function is designed to return only the session data that is expected. Including unnecessary values in the session can increase the token size. If the session data is empty and not set, an error will be thrown.
Browsers have a cookie size limit, typically 4096 bytes. Data exceeding this limit cannot be stored in cookies. If the data exceeds this size, an error will be thrown indicating this issue.
Returns
The Amee session cookie.
Example Usage
You can set the session data as needed for your application.
Along with the session, you can also set the JWT claims using the token
field.