Retrieving session data from a cookie

D

Doug Jolley

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']}"
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top