The session disappears quickly

Asked 2 years ago, Updated 2 years ago, 50 views

I have a question about the session of cakephp.

On one page

$session=$this->getRequest()->getSession();
$session->write('username', 'test');

and on another page.

$session=$this->getRequest()->getSession();
$username=$session->read('username');
var_dump($username);

However, it will be null.

Is there something you haven't set up yet?

The version is
cakephp3.7.4
That's it.

Thank you for your cooperation.

cakephp

2022-09-29 21:49

1 Answers

If you specify a path and URL that does not actually exist in Auth session timeout or CSS or image related (favicon.ico), the session will expire.

Is this site helpful?
https://teratail.com/questions/158808
https://mimirswell.ggnet.co.jp/blog-241


2022-09-29 21:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.