cson  cson_sessmgr_file

ACHTUNG: THIS PAGE IS NOW MAINTAINED IN THE NEW WIKI: http://whiki.wanderinghorse.net/wikis/cson/?page=cson_sessmgr_file

See also: cson_session, cson_sessmgr_cpdo, cson_sessmgr_whio_ht, cson_sessmgr_whio_epfs

File-based cson_session Storage

The factory function cson_sessmgr_file() or the name "file" passed to cson_sessmgr_load() are used to instantiate a session manager for file-based storage. The second argument to either function is a cson_object which should have the following JSON structure:

{
   "dir": string (directory where to store session files),
   "prefix": string (filename prefix),
   "suffix": string (filename suffix (extension), including leading '.')
}

If any values are missing, or are not strings, then unspecified defaults are used (which are probably not best-suited to your application). If you don't want prefix/suffix information, set them to empty strings. If they are not set or set to a non-string value (e.g. null or an integer) then those values are ignored and default values are used.

As an example, if we use this configuration:

{
   "dir": "/tmp",
   "prefix": "cson-session-",
   "suffix": ".json"
}

Then the session files will be named /tmp/cson-session-SESSION_ID.json.