Skip to content
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

Merged
merged 1 commit into from
Feb 26, 2013

Conversation

BernhardPosselt
Copy link
Contributor

...es to prevent a session timeout

should fix #527 and #1934

cc @LukasReschke

@LukasReschke
Copy link
Member

Absolutely awesome!!! 👍
(Tested)

@karlitschek
Copy link
Contributor

👍

karlitschek pushed a commit that referenced this pull request Feb 26, 2013
implemented a heartbeat request which is calls the server every 15 minut...
@karlitschek karlitschek merged commit 7eec315 into master Feb 26, 2013
@karlitschek karlitschek deleted the session_heartbeat branch February 26, 2013 19:02
setInterval(function(){
var url = OC.Router.generate('heartbeat');
$.post(url);
}, 15000);
Copy link
Member

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? 👿

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes looks like it.

@BernhardPosselt
Copy link
Contributor Author

#1941

@tanghus
Copy link
Contributor

tanghus commented Feb 26, 2013

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

@jancborchardt
Copy link
Member

Fuck yes! Thank you Bernhard!

(@tanghus: yeah, I also heard PHP destroys the session after like an hour or so, according to @icewind1991)

@karlitschek
Copy link
Contributor

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.

@tanghus
Copy link
Contributor

tanghus commented Feb 26, 2013

OK, didn't know that. It looked like we deliberately did it in which case the lifebeat would be defeating the purpose ;)

@tanghus
Copy link
Contributor

tanghus commented Feb 28, 2013

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.

@BernhardPosselt
Copy link
Contributor Author

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.

@tanghus
Copy link
Contributor

tanghus commented Feb 28, 2013

It returns the full site in the response here:

heartbeat_response

@BernhardPosselt
Copy link
Contributor Author

no idea cc @bartv2

@bartv2
Copy link
Contributor

bartv2 commented Feb 28, 2013

@tanghus @Raydiation see the PR

@lock lock bot locked as resolved and limited conversation to collaborators Aug 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authentication error on OC_JSON::checkLoggedIn()
7 participants