lib/global_session/rack.rb in global_session-1.0.3 vs lib/global_session/rack.rb in global_session-1.0.4
- old
+ new
@@ -129,12 +129,12 @@
begin
domain = @configuration['cookie']['domain'] || env['SERVER_NAME']
if env['global_session'] && env['global_session'].valid?
value = env['global_session'].to_s
expires = @configuration['ephemeral'] ? nil : env['global_session'].expired_at
- unless env['rack.cookies'].has_key?(@cookie_name) &&
- env['rack.cookies'][@cookie_name] == value
- env['rack.cookies'][@cookie_name] = {:value => value, :domain => domain, :expires => expires}
+ unless env['rack.cookies'].has_key?(@cookie_name) && env['rack.cookies'][@cookie_name] == value
+ env['rack.cookies'][@cookie_name] =
+ {:value => value, :domain => domain, :expires => expires, :httponly=>true}
end
else
# write an empty cookie
env['rack.cookies'][@cookie_name] = {:value => nil, :domain => domain, :expires => Time.at(0)}
end