jQuery Session Keep Alive

Use the setInterval JavaScript method to create a timer that jumpstarts the user session after a specified period of time by calling a server-side script.
<script>
	setInterval(function() { 
		jq.ajax({ url: '/anyServerSideScriptThatUsesSessions' }) 
	}, 1200000); // 20 min
</script>
Posted by
Snippet Viewed 3211 times.

Share your jQuery code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.

 

Submit | Browse

Most Recent jquery snippets

Most Viewed