#223 open
Erik Pukinskis

Sinatra sessions not maintained across requests

Reported by Erik Pukinskis | April 17th, 2009 @ 01:58 PM

If you send multiple requests to a Sinatra app, the session hash is destroyed each time. I've got a little test app demonstrating this here:

http://github.com/erikpukinskis/sinatra-webrat-session-test

I did some investigation, and webrat is passing (path, params, headers) to the request methods of Sinatra's test harness, but according to the Sinatra docs[1], the request methods want (path, params, rack_env) where rack_env is a Hash of Rack environment values.

The docs say you can use the rack_env parameter to pass in session data. I'm trying to put a patch together, but I don't know how to pull the current session hash out of the @browser object.

thanks for any help you can provide!
Erik

[1] http://www.sinatrarb.com/testing.html#sinatratests_mock_request_met...

Comments and changes to this ticket

  • gaffo

    gaffo April 22nd, 2009 @ 12:59 PM

    • Tag changed from rack, sinatra to rack, sinatra, verify
    • State changed from “new” to “open”

    Erik, It would be awesome if you could add your little test case to the sinatra integration tests in webrat and add them here as a pull request. It will make it much easier, and more timely, for us to fix things.

  • Simon Rozet

    Simon Rozet June 24th, 2009 @ 06:49 PM

    • Assigned user set to “Simon Rozet”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages