rack / rack-session

MIT License
32 stars 14 forks source link

Make use of default key value when creating `Rack::Session::Encryptor` #35

Open dentarg opened 8 months ago

dentarg commented 8 months ago

This default value

https://github.com/rack/rack-session/blob/7a4e2dd5625b141e68bb35ecbca2ecae87155c76/lib/rack/session/constants.rb#L9 https://github.com/rack/rack-session/blob/7a4e2dd5625b141e68bb35ecbca2ecae87155c76/lib/rack/session/abstract/id.rb#L241

Isn't used when configuring the Encryptor class:

https://github.com/rack/rack-session/blob/7a4e2dd5625b141e68bb35ecbca2ecae87155c76/lib/rack/session/cookie.rb#L163-L165

use Rack::Session::Cookie and Rack::Session::Cookie, key: "rack.session" is the same, both give you a session cookie with key rack.session, but their signature will be different:

https://github.com/rack/rack-session/blob/7a4e2dd5625b141e68bb35ecbca2ecae87155c76/lib/rack/session/encryptor.rb#L183-L185