smart_cookie_store 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/smart_cookie_store.rb +7 -7
- metadata +2 -2
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ PKG_FILES = FileList[
|
|
11
11
|
|
12
12
|
spec = Gem::Specification.new do |s|
|
13
13
|
s.name = "smart_cookie_store"
|
14
|
-
s.version = "0.0.
|
14
|
+
s.version = "0.0.5"
|
15
15
|
s.author = "Urban Hafner"
|
16
16
|
s.email = "urban@bettong.net"
|
17
17
|
s.homepage = "http://github.com/msales/smart_cookie_store"
|
data/lib/smart_cookie_store.rb
CHANGED
@@ -16,7 +16,7 @@ class SmartCookieStore < ActionController::Session::CookieStore
|
|
16
16
|
cookie = Hash.new
|
17
17
|
|
18
18
|
session_keys = session_data.keys.reject {|k| k == :session_id }
|
19
|
-
|
19
|
+
if !session_keys.empty? && session_keys.any? {|k| session_data[k].present?}
|
20
20
|
marshaled_session_data = marshal(session_data.to_hash)
|
21
21
|
|
22
22
|
raise CookieOverflow if marshaled_session_data.size > MAX
|
@@ -25,12 +25,12 @@ class SmartCookieStore < ActionController::Session::CookieStore
|
|
25
25
|
unless options[:expire_after].nil?
|
26
26
|
cookie[:expires] = Time.now + options[:expire_after]
|
27
27
|
end
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
cookie = build_cookie(@key, cookie.merge(options))
|
29
|
+
unless headers[HTTP_SET_COOKIE].blank?
|
30
|
+
headers[HTTP_SET_COOKIE] << "\n#{cookie}"
|
31
|
+
else
|
32
|
+
headers[HTTP_SET_COOKIE] = cookie
|
33
|
+
end
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|