dalli 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of dalli might be problematic. Click here for more details.
- data/History.md +6 -0
- data/lib/action_dispatch/middleware/session/dalli_store.rb +30 -27
- data/lib/dalli/version.rb +1 -1
- metadata +2 -2
data/History.md
CHANGED
@@ -28,43 +28,46 @@ module ActionDispatch
|
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
31
|
-
|
32
|
-
def get_session(env, sid)
|
33
|
-
sid ||= generate_sid
|
34
|
-
begin
|
35
|
-
session = @pool.get(sid) || {}
|
36
|
-
rescue Dalli::DalliError
|
37
|
-
Rails.logger.warn("Session::DalliStore#get: #{$!.message}")
|
38
|
-
session = {}
|
39
|
-
end
|
40
|
-
[sid, session]
|
41
|
-
end
|
42
31
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
@pool.
|
47
|
-
sid
|
32
|
+
def get_session(env, sid)
|
33
|
+
sid ||= generate_sid
|
34
|
+
begin
|
35
|
+
session = @pool.get(sid) || {}
|
48
36
|
rescue Dalli::DalliError
|
49
|
-
Rails.logger.warn("Session::DalliStore#
|
50
|
-
|
37
|
+
Rails.logger.warn("Session::DalliStore#get: #{$!.message}")
|
38
|
+
session = {}
|
51
39
|
end
|
40
|
+
[sid, session]
|
41
|
+
end
|
42
|
+
|
43
|
+
def set_session(env, sid, session_data, options = nil)
|
44
|
+
options ||= env[ENV_SESSION_OPTIONS_KEY]
|
45
|
+
expiry = options[:expire_after]
|
46
|
+
@pool.set(sid, session_data, expiry)
|
47
|
+
sid
|
48
|
+
rescue Dalli::DalliError
|
49
|
+
Rails.logger.warn("Session::DalliStore#set: #{$!.message}")
|
50
|
+
false
|
51
|
+
end
|
52
52
|
|
53
|
-
|
53
|
+
def destroy_session(env, session_id, options)
|
54
|
+
begin
|
54
55
|
@pool.delete(session_id)
|
55
56
|
rescue Dalli::DalliError
|
56
57
|
Rails.logger.warn("Session::DalliStore#destroy_session: #{$!.message}")
|
57
|
-
false
|
58
58
|
end
|
59
|
+
return nil if options[:drop]
|
60
|
+
generate_sid
|
61
|
+
end
|
59
62
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
64
|
-
rescue Dalli::DalliError
|
65
|
-
Rails.logger.warn("Session::DalliStore#destroy: #{$!.message}")
|
66
|
-
false
|
63
|
+
def destroy(env)
|
64
|
+
if sid = current_session_id(env)
|
65
|
+
@pool.delete(sid)
|
67
66
|
end
|
67
|
+
rescue Dalli::DalliError
|
68
|
+
Rails.logger.warn("Session::DalliStore#destroy: #{$!.message}")
|
69
|
+
false
|
70
|
+
end
|
68
71
|
|
69
72
|
end
|
70
73
|
end
|
data/lib/dalli/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dalli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.1.
|
5
|
+
version: 1.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Perham
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-09-06 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|