Skip to content

Instantly share code, notes, and snippets.

@magnars
Created April 20, 2012 07:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save magnars/2426786 to your computer and use it in GitHub Desktop.
Keep session alive
@RequestMapping("/session/keepAlive.json")
public void sessionKeepalive(Model json) {
json.addAttribute("result", "ok");
}
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