# Lightweight sessions?

**URL:** <https://www.ruby-forum.com/t/lightweight-sessions/133449>\
**Category:** Ruby\
**Created:** [March 31, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/lightweight-sessions/133449 "2008-03-31T18:36:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Casimir\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/839c29/32.png) [@Casimir\_P](https://www.ruby-forum.com/u/Casimir_P)\
**Post date:** [March 31, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/lightweight-sessions/133449/1 "2008-03-31T18:36:57Z")

</div>

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](http://csmr.dreamhosters.com)

---

<div class="post-metadata">

**Author:** ![Casimir\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/839c29/32.png) [@Casimir\_P](https://www.ruby-forum.com/u/Casimir_P)\
**Post date:** [March 31, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/lightweight-sessions/133449/2 "2008-03-31T20:11:11Z")

</div>

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

> **[EpsilonDelta.net is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=epsilondelta.net)**
>
> Get your very own domain easily. Fast and professional customer service.

Good luck.  
–Kyle

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

---

<div class="post-metadata">

**Author:** ![Casimir\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/839c29/32.png) [@Casimir\_P](https://www.ruby-forum.com/u/Casimir_P)\
**Post date:** [April 1, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/lightweight-sessions/133449/3 "2008-04-01T20:11:04Z")

</div>

On 31.03.2008 20:10, Kyle S. 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/Session.html](http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/classes/CGI/Session.html)

See [http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html](http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html)

Kind regards

robert
