This rack middleware automatically sets the rack session domain to the current domain.
eg. env["rack.session.options"][:domain] = 'domain1.com'
This is handy if you want your rack app to serve multiple domains and have access to the session data across all subdomains. For example, let's say your app serves the following domains:
The session cookies will now automatically be accessible across all subdomains on *.domain1.com and *.domain2.co.uk respectively.