Skip to content

Commit

Permalink
allow secure session cookies through proxy or to localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmcgarvey committed Mar 1, 2024
1 parent c84d5de commit b10ff4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rack/session/abstract/id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ def force_options?(options)

def security_matches?(request, options)
return true unless options[:secure]
request.ssl?
# OK to send a secure token over ssl, or to local host
# or if the instance is running behind a proxy that handles ssl
request.ssl? || request.host == 'localhost' || options[:trust_proxy]
end

# Acquires the session from the environment and the session id from
Expand Down

0 comments on commit b10ff4d

Please sign in to comment.