I have
Session::$default='database';
$session=Session::instance();
and
$session->id() displays session’s value now.
The value is stored in the sessions table as well.
Everything seems to work fine.
My question is: how to check if session exists in another action.
The $_SESSION array is undefined.
To access the session from any controller action or view template, simply use:
For example:
To overload $_SESSION with the Kohana session, run the following inside each action method: