Hi there,
I have a fully worked "remember me" feature in my Application that set some cookies with long expiration time in browser. (as explained in Vokuro sample)
I want to add some extra cookies for XSRF key and value, so I try to add those cookies in bootstrap file before $application->handle()->send();
line:
Bootstrap file
. . .
try {
$application = new PhApplication($this->_di);
$application->cookies->set('XSRF-TOKEN-KEY', $application->security->getTokenKey());
$application->cookies->set('XSRF-TOKEN', $application->security->getToken());
PhDi::setDefault($this->_di);
$application->handle()->send();
} catch (PhException $e) {
echo $e->getMessage();
} catch (\PDOException $e) {
echo $e->getMessage();
}
. . .
but when I refresh page, the expiration time of "remember me" cookies change, so when I close browser and open it again, the auto-login does not work. When I remove XSRF-TOKEN
line, every thing work perfectly.
How can I set some global, application-specific cookies? Is it about order of cookies settings?
Thanks