Retrieving session data from a cookie

The pick-axe book describes a method for retrieving cookie-based session
data from within a cgi script. It works fine from within a cgi script.
What I would really like to know is how I can accomplish this feat of
retrieving the same data from within embedded Ruby. Can anyone help me
out on this one? Thanks for any input. FWIW, I’m appending what the
pick-axe book has to say about doing it from a cgi script. Thanks for
any input.

  ... doug

Pick Axe Book:

require “cgi”
require “cgi/session”

cgi = CGI.new(“html3”)
sess = CGI::Session.new( cgi, “session_key” => “rubyweb”,
“prefix” => “web-session.”)
cgi.out{
cgi.html{
“\nCustomer #{sess[‘CustID’]} orders an #{sess[‘Part’]}”
}
}