Debugging technique for Rails: decode the session cookie
Posted 16 July 2008 @ 2pm | Tagged RubyOnRails
Ever try to debug a problem and needed to see what was inside the user’s session at the time? If you’re using the cookie session store (Rails 2.x), you can now use this tool to take a look:
Simply invoke it like this:
DebugTools.show_session("your long session id goes in here")
The code deals with linebreaks automatically, so don’t worry about formatting the string, just cut, paste and enjoy.



1 Comment