Created
April 20, 2012 07:12
-
-
Save magnars/2426786 to your computer and use it in GitHub Desktop.
Keep session alive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping("/session/keepAlive.json") | |
public void sessionKeepalive(Model json) { | |
json.addAttribute("result", "ok"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keepSessionAlive = function () { | |
jQuery.get("/session/keepAlive.json", {}); | |
}; | |
var keepSessionAliveWhileRegistering = function () { | |
setInterval(keepSessionAlive, 1000 * 60 * 50); // every 50 minutes | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment