Reputation: 337
I am working with CakePHP 3 and also I use the build in AuthComponent. I have a page that I don't want the session to expire in order not to log out the users.
What is the best practice to renew the session id ? I thought to make an ajax request every 10 min. to renew the session before expiration. $this->request->session()->renew(); Will the method renew in session work for this ?
Is any better solution ?
Upvotes: 2
Views: 603
Reputation: 9614
Just sending a request to CakePHP and reading from the session, maybe just reading the user id, will extend the session time for the user. There is no need to call renew()
Upvotes: 2