Retrieving session data from a cookie

Discussion in 'Ruby' started by Doug Jolley, Feb 20, 2009.

  1. Doug Jolley

    Doug Jolley Guest

    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']}"
    }
    }
    --
    Posted via http://www.ruby-forum.com/.
     
    Doug Jolley, Feb 20, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    3
    Views:
    5,860
    Steven Cheng[MSFT]
    Jun 3, 2004
  2. Shapper

    Cookie and Session Cookie Questions.

    Shapper, Apr 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    576
  3. =?Utf-8?B?amVycnkueHVkZGQ=?=

    session cookie and presist cookie?

    =?Utf-8?B?amVycnkueHVkZGQ=?=, Mar 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    487
    =?Utf-8?B?RGFycmVuIEtvcHA=?=
    Mar 8, 2006
  4. Joseph

    authentication cookie vs session cookie

    Joseph, Aug 8, 2003, in forum: ASP .Net Security
    Replies:
    4
    Views:
    394
    Yan-Hong Huang[MSFT]
    Aug 12, 2003
  5. Vikram Bhatia
    Replies:
    1
    Views:
    237
    kaeli
    Oct 11, 2003
Loading...

Share This Page