Prevent extending session lifetime on specific route
I've written a function to check if the user is currently logged in. But when the user is accessing this function, I don't want the session lifetime to be extended. Is it possible to let users access a route without extending their session lifetime? Thanks~
You could perhaps use an api request (no session) to check the database for an active session manually. Will require that you use the database driver. But as there is no session, you need some other way to find the right record
Edit: sorry snapey. Didn't see your answer was almost the same :)
@snapey@sinnbeck Thanks for your reply. It seems that there isn't an easy way to deal with that. Holding off checking until the session lifetime reaching might not work on my website. Because they usually need to open more than one tab on my website.
@gnsjhenjie but thats the point. A user is working happily in one tab, and another tab should NOT expire their session. Nor should it poll so frequently that it keeps the session going.
It should wait until the session might have closed and then test it.
Perhaps if you explained WHY you want to do this, we might be able to suggest a better solution.