Hi all,
How can rename the session_name in my controller?
This is my example code which I have in my bootstrap file
/**
* Start the session the first time some component requests the session service
*/
$di->setShared('session', function () {
try {
$session = new SessionAdapter();
$session->name('oldName');
$session->start();
return $session;
} catch (Exception $ex) {
echo "Fatal session error, session not instantiated";
die;
}
});
And this is my controller source code
class SessionController extends Phalcon\Mvc\Controllers
{
public function initialize()
{
// destroy the whole session
$this->session->destroy();
// set session ID = token
$token = 123;
$this->session->setId($token);
$expire=8*20*10;
$this->session->start();
// PHP way session_name("myApp");
//Phalcon way ???? [session_name, cache_expire, cookie_params etc]
}
}
Thanks!