New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling session #1
Comments
D'oh! Good catch. I'll write a test for that and figure something out. My intention was just to delay the test for it as long as possible, to give the application a chance to set up its own session preferences. |
Yes. Only problem here is, Rack::Session gets set up in Sinatra::Base.new. |
I think you could do something like this:
Not tested. You'd have to pass some headers (set-cookie) to the current headers. |
Yeah, I see your point. So setting the option does nothing after that. Looking at it closer, I see a bigger problem: just testing on I could test on that, of course, and set the same Rack::Session::Cookie that Sinatra defaults to if it isn't there. But then it's starting to get complicated. The other option would be just to back it out and say "Create a session before you use this" like Rack::Flash does. I'm not sure at the moment which one I like better. Do you have an opinion? (Update: This is a reply to your next-to-last comment, not the comment just before this, which I hadn't read yet. I don't think that code will work because |
Oh, but you could use There is an even bigger problem: If you just did a Maybe you should just do a |
Checking The more I think about it, between all of these issues and Sinatra's attempts to hide the session details (you can't even test I'm just going to pull out the "Create a session for you" code and tell the user it's up to them. Anyone using Sinatra instead of Rails is probably clueful enough to know how to do this anyway. >8-> Thank you very much for raising the issue. If you hadn't, it would likely have been a long time before I realized this wasn't working. I appreciate your time and help. |
No problem, your extension seems promising. Thinking about replacing Rack::Flash with it for BigBand. |
Cool! Let me know how it goes. >8-> |
Enabling session in an after hook will use it starting from the next request, but not for the current.
The text was updated successfully, but these errors were encountered: