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 =“html3”)
sess = cgi, “session_key” => “rubyweb”,
“prefix” => “web-session.”)
“\nCustomer #{sess[‘CustID’]} orders an #{sess[‘Part’]}”