Methods for handling sessions.

Method Description Available from version
Starts a session, assigns necessary options for secure operation, calls session_start(). Repeated method call doesn't return error and a restart.
Gets session ID.
Sets session ID. When session is active, throws an exception \RuntimeException.
Gets session name.
Sets session name. In case of active session, throws an exception \RuntimeException.
\Bitrix\Main\Session\SessionInterface::regenerateId(): bool
Generates new session ID with saving all values. Contrary to the session_regenerate_id() considers possible issues with unstable internet connection.
Saves session data and closes it.
Returns true, when session has the key $name.
Returns value in session by the key $name.
\Bitrix\Main\Session\SessionInterface::set($name, $value)
Sets the $value by the key $name.
Deletes value in session by key $name.
Deletes all values, available in session.
Returns true when session has started successfully.

© «Bitrix24», 2001-2023