Forum: Ruby Retrieving session data from a cookie

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Doug J. (Guest)
on 2009-02-20 22:26
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']}"
This topic is locked and can not be replied to.