Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ruby: decode rack session cookie
require 'base64'
require 'cgi'
def show_session(cookie)
Marshal.load(Base64.decode64(CGI.unescape(cookie.split("\n").join).split('--').first))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment