The 0.8 way to do sessions...

19 views
Skip to first unread message

Chris Hansen

unread,
Nov 26, 2013, 1:19:38 PM11/26/13
to pak...@googlegroups.com
What is the correct way to do sessions under 0.8?  I'm guessing there should now be a middleware.rb file under lib where the initialization happens, etc. Am I on the right track?  When do I go from there?

Thanks!

--Chris Hansen

Bryan Powell

unread,
Nov 27, 2013, 10:58:59 AM11/27/13
to pak...@googlegroups.com
In the Pakyow::App.define block (app.rb) define a middleware block and use the Rack::Session::Cookie middleware. Something like this:


Hope this helps!

Bryan P.
--
You received this message because you are subscribed to the Google Groups "Pakyow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pakyow+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Chris Hansen

unread,
Nov 27, 2013, 3:07:49 PM11/27/13
to pak...@googlegroups.com
Bryan,

Thanks, but I'm still stuck.  I start getting server errors when I put in that code.  I replaced the secret, but what should be using as "myapp" in myapp.session?  That looks like filler, but I'm not sure what to fill it with.  I've been looking at the documentation for the warmup (since that's all there is for 0.8), but I'm missing something somewhere.

Thank you again for all your help.  Best,

--Chris

Bryan Powell

unread,
Nov 27, 2013, 3:09:47 PM11/27/13
to pak...@googlegroups.com
Can you post a gist with the error you’re getting?

Chris Hansen

unread,
Nov 27, 2013, 3:39:32 PM11/27/13
to pak...@googlegroups.com
Bryan,

Thanks for the quick response.  It's working now.  It's either the fact that I ate lunch (less likely) or restarted the server process (more likely.)  Thank you again for all your help.

--Chris

Bryan Powell

unread,
Nov 27, 2013, 4:38:57 PM11/27/13
to pak...@googlegroups.com
Great, glad it’s working! Feel free to ask if you hit anything else.
Reply all
Reply to author
Forward
0 new messages