Webrick and Cookies

G

Guest

Using a WEBrick::HTTPServer can some point me to an example
of using cookies with Webrick? Even better would an example of using sessions.

I am writing an application that, hopefully, will run on Apache and Webrick.

Thanks!
 
A

Andreas Schwarz

Using a WEBrick::HTTPServer can some point me to an example
of using cookies with Webrick?

Look at webrick/cookie.rb. It think you can write:

cookie = Webrick::Cookie.new(name, value)
response.cookies += cookie

But be careful, it looks like Webrick does not take care of any special
characters in the cookie value.
 
G

gabriele renzi

il 23 Jun 2004 06:32:26 GMT, Andreas Schwarz <[email protected]> ha
scritto::

I wonder if it could be possibile to unify Webrick::Cookie and
CGI::Cookie, and provide a WEBRick::Something to be used with
CGI::Session.
I believe that having a simple Session mechanism in webrick would be
really useful, or people is going to implement it by themself
continuosly (with resulting slow, buggy, unsecure implementations)
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top