summaryrefslogtreecommitdiffstats
path: root/docs/lang/ruby/rack_session_cookie.rb
blob: 5b0a62ae28eb6df47ad1daf1b4ab44740938e7df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
require 'base64'
require 'cgi'

# 'SessionId' class possibly not provided by import.
# A dummy definition is needed for the Marshal.load()
#require 'rack'
class Rack::Session::SessionId
end

cookie = "....."

obj = Marshal.load(Base64.decode64(CGI.unescape(cookie.split("\n").join).split('--').first))