Skip to content

Commit

Permalink
Restore cookie store httponly default to true. Remove extraneous dup …
Browse files Browse the repository at this point in the history
…of options on initialization [#1784 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
Cody Fauser authored and josh committed Jan 20, 2009
1 parent 9cefd5e commit c090e5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions actionpack/lib/action_controller/session/cookie_store.rb
Expand Up @@ -45,7 +45,7 @@ class CookieStore
:domain => nil,
:path => "/",
:expire_after => nil,
:httponly => false
:httponly => true
}.freeze

ENV_SESSION_KEY = "rack.session".freeze
Expand All @@ -56,8 +56,6 @@ class CookieStore
class CookieOverflow < StandardError; end

def initialize(app, options = {})
options = options.dup

# Process legacy CGI options
options = options.symbolize_keys
if options.has_key?(:session_path)
Expand Down
4 changes: 2 additions & 2 deletions actionpack/test/controller/session/cookie_store_test.rb
Expand Up @@ -94,7 +94,7 @@ def test_setting_session_value
with_test_route_set do
get '/set_session_value'
assert_response :success
assert_equal ["_myapp_session=#{response.body}; path=/"],
assert_equal ["_myapp_session=#{response.body}; path=/; httponly"],
headers['Set-Cookie']
end
end
Expand Down Expand Up @@ -148,7 +148,7 @@ def test_setting_session_value_after_session_reset
get '/set_session_value'
assert_response :success
session_payload = response.body
assert_equal ["_myapp_session=#{response.body}; path=/"],
assert_equal ["_myapp_session=#{response.body}; path=/; httponly"],
headers['Set-Cookie']

get '/call_reset_session'
Expand Down

0 comments on commit c090e5e

Please sign in to comment.