sessions - Implements sessions for Extenso
session_get(key:string[, withexp: boolean]); session_set (key:string,value:string[,exp:string]); session_del (keys:string);
These functions are used to implement a session.
session_set gets the current session cookie, the key passed in parameter and the expiration date if any and saves the value in the database. If the key already exists, it is replaced.
The database right now is mariadb and the table is sn_sessions. This might change in the future.
session_get retrieves a value corresponding to the key and the cookie of the user.
session_del is used to delete keys from the database.
Note: In the followings examples, the _ between the { should be removed to make it work.
{_{ %include "/extenso/functions/sessions.snc"; }} \{_{ session_set("captcha",c[1], exp:"+300s"); session_get("captcha"); session_del("key1","key2"); }}
Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
1.0 2014-09-09 21:24:14 laplante@sednove.com