session-check 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -1
- data/app/views/_session_check.html.erb +4 -2
- data/lib/session/check/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -20,4 +20,11 @@ A JS timeout checks a value supplied from your Devise config, and when it determ
|
|
20
20
|
it takes the user to the sign in page. A global AJAX listener ensures AJAX heavy apps are catered for, by listening to each
|
21
21
|
request and resetting the counter for you.
|
22
22
|
|
23
|
-
No server ping requests are made, so there is no extra load on your server.
|
23
|
+
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.
|
24
|
+
|
25
|
+
# Non-refreshing logins
|
26
|
+
|
27
|
+
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
|
28
|
+
their browser, you can start the ping process by calling:
|
29
|
+
|
30
|
+
SessionCheck.should_session_check = true;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<script>
|
2
|
-
var
|
2
|
+
var SessionCheck = {
|
3
|
+
should_session_check: <%= !current_user.nil? %>
|
4
|
+
};
|
3
5
|
(function () {
|
4
6
|
var check_every_s = <%= check_every %>;
|
5
7
|
var session_time_left = <%= session_time %>;
|
@@ -8,7 +10,7 @@
|
|
8
10
|
};
|
9
11
|
var session_check = function () {
|
10
12
|
session_time_left = session_time_left - check_every_s;
|
11
|
-
if (should_session_check && session_time_left < 0) {
|
13
|
+
if (SessionCheck.should_session_check && session_time_left < 0) {
|
12
14
|
$.get('/session_check/time_to_session_expiry')
|
13
15
|
.done(function (d) {
|
14
16
|
if (!d.session_exists) {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: session-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
type: :runtime
|