-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implemented a heartbeat request which is calls the server every 15 minut... #1938
Conversation
…nutes to prevent a session timeout
Absolutely awesome!!! 👍 |
👍 |
implemented a heartbeat request which is calls the server every 15 minut...
setInterval(function(){ | ||
var url = OC.Router.generate('heartbeat'); | ||
$.post(url); | ||
}, 15000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's 15 secs, right? 👿
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes looks like it.
Why do we destroy the session at all? We've already had one lifebeat function that was removed because it didn't work if the PC was suspended or hibernated. To me it doesn't make much sense to destroy the session after a timeout, and then implement a way to prevent it. /cc @jancborchardt |
Fuck yes! Thank you Bernhard! (@tanghus: yeah, I also heard PHP destroys the session after like an hour or so, according to @icewind1991) |
Every PHP session expires automatically after some time. Default 30min of inactivity. Changing the default doesn't work in all server setup. So the heartbeat is the best solution. |
OK, didn't know that. It looked like we deliberately did it in which case the lifebeat would be defeating the purpose ;) |
Should the heartbeat really load the entire site on each request? On a desktop with unlimited data plan it's not an issue, but with a limited data plan it could be. |
It loads nothing. It just pings an emty route which includes the lib/base.php also the ping happens every 15 minutes, should be a non issue. |
no idea cc @bartv2 |
@tanghus @Raydiation see the PR |
...es to prevent a session timeout
should fix #527 and #1934
cc @LukasReschke