[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Lightweight sessions?

Casimir Pohjanraito

3/31/2008 4:32:00 PM

I am building a chat for some friends. Philosophy: just for fun.

I am not on rails, nor do I plan on welding any on the simple shared
hosting service that offers ruby 1.8 and eruby.

Anybody seen simple, lightweight session management lib for situation
like this?

Cookies, simple authication, thats about it. Something that can tell
serverside forms if user is logged in or not, basically.

I have read about cgi.session, but was wondering if someone has "worked
it further down the line..."

*Any* suggestions on how to approach/do it welcome.

Casimir
csmr.dreamhosters.com
2 Answers

Kyle Schmitt

3/31/2008 6:11:00 PM

0

If you're not too worried about security, you can always generate a
session similar to the way it's done for a web server (which honestly
is done from the ultra lame to the insanely overly complex). I didn't
notice a session id method in the standard Net/HTTP library, but that
doesn't mean there isn't one.

If you don't want to come up with your own, this article examines how
RoR generates session IDs*. It ends up being very simple, easy to
understand code
http://epsilondelta.net/2006/05/17/examining-rubys-http-session-id-g...

Good luck.
--Kyle

* Or at least how RoR generated session IDs in 2006.

Robert Klemme

4/1/2008 6:08:00 PM

0

On 31.03.2008 20:10, Kyle Schmitt wrote:
> If you're not too worried about security, you can always generate a
> session similar to the way it's done for a web server (which honestly
> is done from the ultra lame to the insanely overly complex). I didn't
> notice a session id method in the standard Net/HTTP library, but that
> doesn't mean there isn't one.

http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/classes/CGI/Se...

See http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/...

Kind regards

robert