Skip to content

Commit

Permalink
Expose same_site instance variable. Fixes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 12, 2022
1 parent 8a4a5f3 commit b00e546
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/session/abstract/id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class Persisted
secure_random: ::SecureRandom
}.freeze

attr_reader :key, :default_options, :sid_secure
attr_reader :key, :default_options, :sid_secure, :same_site

def initialize(app, options = {})
@app = app
Expand Down
1 change: 1 addition & 0 deletions test/spec_session_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@

it "passes through same_site option to session pool" do
pool = Rack::Session::Pool.new(incrementor, same_site: :none)
pool.same_site.must_equal :none
req = Rack::MockRequest.new(pool)
res = req.get("/")
res["Set-Cookie"].must_include "SameSite=None"
Expand Down

0 comments on commit b00e546

Please sign in to comment.