0.0
No release in over a year
A gem for JS clients to check if their session has expired.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
>= 5.0
 Project Readme

Session Check

A gem that returns you to your application's sign in page when your Devise session expires.

Usage

Include the gem in your Gemfile...

gem 'session-check'

... and include the helper tag in your layout.erb, anywhere in the tag.

<%= session_check %>

You're done.

How it works

A JS timeout checks a value supplied from your Devise config, and when it determines that the Devise session has expired, it takes the user to the sign in page. A global AJAX listener ensures AJAX heavy apps are catered for, by listening to each request and resetting the counter for you.

No server ping requests are made until the moment the session is expected to be expired, so there is no extra load on your server.

Non-refreshing logins

If a user is not lot logged in, then no server pings will be perfomed. If, however, you application logs a user in without refreshing their browser, you can start the ping process by calling:

SessionCheck.should_session_check = true;

Changelog

Version 0.2.1 : Added explicit reference to Devise (which is required)