Skip to content
Snippets Groups Projects
Commit 4e553480 authored by Bernhard Posselt's avatar Bernhard Posselt
Browse files

implemented a heartbeat request which is calls the server every 15 minutes to...

implemented a heartbeat request which is calls the server every 15 minutes to prevent a session timeout
parent b987c76d
No related branches found
No related tags found
No related merge requests found
......@@ -584,6 +584,7 @@ function fillWindow(selector) {
}
$(document).ready(function(){
sessionHeartBeat();
if(!SVGSupport()){ //replace all svg images with png images for browser that dont support svg
replaceSVG();
......@@ -815,3 +816,17 @@ OC.set=function(name, value) {
}
context[tail]=value;
};
/**
* Calls the server periodically every 15 mins to ensure that session doesnt
* time out
*/
function sessionHeartBeat(){
OC.Router.registerLoadedCallback(function(){
setInterval(function(){
var url = OC.Router.generate('heartbeat');
$.post(url);
}, 15000);
});
}
\ No newline at end of file
......@@ -69,3 +69,8 @@ $this->create('app_script', '/apps/{app}/{file}')
->defaults(array('file' => 'index.php'))
->requirements(array('file' => '.*.php'))
->action('OC', 'loadAppScriptFile');
// used for heartbeat
$this->create('heartbeat', '/heartbeat')->action(function(){
// do nothing
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment