F.32. Sessions

FunctionReturnsDescription
session_set_cookie_params(int lifetime [, string path [, string domain [, bool secure]]])
voidSets session cookie parameters.
session_get_cookie_params(void)
arrayReturns the session cookie parameters.
session_name([string newname])
stringReturns the current session name. If newname is given, the session name is replaced with newname.
session_module_name([string newname])
stringReturns the current module name used for accessing session data. If newname is given, the module name is replaced with newname.
session_set_save_handler(string open, string close, string read, string write, string destroy, string gc)
voidSets user-level functions.
session_save_path([string newname])
stringReturns the current save path passed to module_name. If newname is given, the save path is replaced with newname.
session_id([string newid])
stringReturns the current session_id. If newid is given, the session_id is replaced with newid.
session_regenerate_id()
boolUpdates the current session_id with a newly generated one.
session_cache_limiter([string new_cache_limiter])
stringReturns the current cache limiter. If new_cache_limiter is given, the current cache_limiter is replaced with new_cache_limiter.
session_cache_expire([int new_cache_expire])
intReturns the current cache expire. If new_cache_expire is given, the current cache_expire is replaced with new_cache_expire.
session_register(mixed var_names [, mixed ...])
boolAdds varname(s) to the list of variables ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.