You are here

function session_cache_set in Session Cache API 7

Same name in this branch
  1. 7 session_cache.api.php \session_cache_set()
  2. 7 session_cache.module \session_cache_set()
Same name and namespace in other branches
  1. 8 session_cache.module \session_cache_set()
  2. 6 session_cache.module \session_cache_set()

Write data to the user session, whatever the storage mechanism may be.

Parameters

string $bin: Unique id, eg a string prefixed by the module name.

mixed $data: A number or string, an object, a multi-dimensional array etc. $bin is the identifier you choose for the data you want to store. To guarante uniqueness, you could prefix it with the name of the module that you use this API with. Use NULL to erase the bin; it may be auto-recreated and refilled at any time by calling the function again with a non-NULL data argument.

File

./session_cache.api.php, line 26
API documentation for Session Cache API module.

Code

function session_cache_set($bin, $data) {

  // See the following modules for examples:
  // o IP Geolocation Views & Maps.
  // o Views Global Filter.
}