auto-session-timeout-warning 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,16 +1,14 @@
1
- # auto-session-timeout
1
+ # auto-session-timeout-warning
2
2
 
3
- Provides automatic session timeout in a Rails application. Very easy
4
- to install and configure. Have you ever wanted to force your users
5
- off your app if they go idle for a certain period of time? Many
6
- online banking sites use this technique. If your app is used on any
7
- kind of public computer system, this plugin is a necessity.
3
+ This provides warning message before auto session timeout in Rails application,
4
+ if you don't looking for warning message before session timeout please check source gem
5
+ https://github.com/pelargir/auto-session-timeout
8
6
 
9
7
  ## Installation
10
8
 
11
9
  Add this line to your application's Gemfile:
12
10
 
13
- gem 'auto-session-timeout'
11
+ gem 'auto-session-timeout-warning'
14
12
 
15
13
  And then execute:
16
14
 
@@ -18,82 +16,44 @@ And then execute:
18
16
 
19
17
  Or install it yourself as:
20
18
 
21
- $ gem install auto-session-timeout
19
+ $ gem install auto-session-timeout-warning
22
20
 
23
21
  ## Usage
22
+ Add jquery and jquery-ui on your application.js file
24
23
 
25
- After installing, tell your application controller to use auto timeout:
24
+ and follow all usage steps as for https://github.com/pelargir/auto-session-timeout.
26
25
 
27
- class ApplicationController < ActionController::Base
28
- auto_session_timeout 1.hour
29
- ...
30
- end
31
-
32
- You will also need to insert this line inside the body tags in your
33
- views. The easiest way to do this is to insert it once inside your
34
- default or application-wide layout. Make sure you are only rendering
35
- it if the user is logged in, otherwise the plugin will attempt to force
36
- non-existent sessions to timeout, wreaking havoc:
37
-
38
- <body>
39
- <% if current_user %>
40
- <%= auto_session_timeout_js %>
41
- <% end %>
42
- </body>
43
-
44
- You need to setup two actions: one to return the session status and
45
- another that runs when the session times out. You can use the default
46
- actions included with the plugin by inserting this line in your target
47
- controller (most likely your user or session controller):
48
-
49
- class SessionsController < ApplicationController
50
- auto_session_timeout_actions
51
- end
52
-
53
- To customize the default actions, simply override them. You can call
54
- the render_session_status and render_session_timeout methods to use
55
- the default implementation from the plugin, or you can define the
56
- actions entirely with your own custom code:
57
-
58
- class SessionsController < ApplicationController
59
- def active
60
- render_session_status
61
- end
62
-
63
- def timeout
64
- render_session_timeout
65
- end
66
- end
67
-
68
- In any of these cases, make sure to properly map the actions in
69
- your routes.rb file:
70
-
71
- match 'active' => 'sessions#active', via: :get
72
- match 'timeout' => 'sessions#timeout', via: :get
73
-
74
- You're done! Enjoy watching your sessions automatically timeout.
75
-
76
- ## Additional Configuration
77
-
78
- By default, the JavaScript code checks the server every 60 seconds for
79
- active sessions. If you prefer that it check more frequently, pass a
80
- frequency attribute to the helper method. The frequency is given in
81
- seconds. The following example checks the server every 15 seconds:
26
+ Check below configuration for warning message
82
27
 
28
+ ## Warning message Configuration
83
29
  <html>
84
30
  <head>...</head>
85
31
  <body>
86
32
  <% if current_user %>
87
- <%= auto_session_timeout_js frequency: 15 %>
33
+ <%= auto_session_timeout_js timeout: 60, frequency: 60, start: 60, warning: 20 %>
88
34
  <% end %>
89
35
  ...
90
36
  </body>
91
37
  </html>
92
38
 
39
+ frequency refers to how frequently browser interactive with server to find the session details,
40
+
41
+ timeout refers to auto session time out, if you set auto_session_timeout: 2.minutes on application_controller, you should set 120 seconds here,
42
+
43
+ start describes the starting time of server interaction, if it is 60, first server interaction will start after 60 seconds,
44
+
45
+ warning describes the starting time of warning message before session timed out, if is 20, dialog warning message will popup before 20 seconds of timeout.
46
+
47
+ Default values here:
48
+
49
+ timeout: 60,
50
+ frequecy: 60,
51
+ start: 60,
52
+ warning: 20
53
+
93
54
  ## TODO
94
55
 
95
56
  * current_user must be defined
96
- * using Prototype vs. jQuery
97
57
  * setting timeout in controller vs. user
98
58
 
99
59
  ## Contributing
@@ -106,6 +66,4 @@ seconds. The following example checks the server every 15 seconds:
106
66
 
107
67
  ## Resources
108
68
 
109
- * Repository: http://github.com/pelargir/auto-session-timeout/
110
- * Blog: http://www.matthewbass.com
111
- * Author: Matthew Bass
69
+ * Source Repository: http://github.com/pelargir/auto-session-timeout/
@@ -6,7 +6,7 @@ require 'auto/session/timeout/warning/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "auto-session-timeout-warning"
8
8
  spec.version = Auto::Session::Timeout::Warning::VERSION
9
- spec.authors = ["Matthew Bass","Krishna Srihari"]
9
+ spec.authors = ["Krishna Srihari"]
10
10
  spec.email = ["krishna.srihari@gmail.com"]
11
11
  spec.description = %q{jQuery automatic session timeout warning in a Rails application.}
12
12
  spec.summary = %q{jQuery automatic session timeout in a Rails application.}
@@ -2,7 +2,7 @@ module Auto
2
2
  module Session
3
3
  module Timeout
4
4
  module Warning
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto-session-timeout-warning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Matthew Bass
9
8
  - Krishna Srihari
10
9
  autorequire:
11
10
  bindir: bin