Forum: Ruby on Rails What's the maximum storage size of a Session ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
460ead051b49c0b2a8e45e46252d4bda?d=identicon&s=25 Tom Ha (tom)
on 2008-12-22 01:07
Hi there,

does anyone know (for sure) how much data we can technically store in
and later retrieve from a Rails session?

The other option to store and retrieve a really big chunk of data seems
to be a Marshal dump+load. But since this seems more complicated than
with a session, I'd prefer to work with the session if possible.

Thanks for your help!
Tom
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2008-12-22 01:19
(Received via mailing list)
Tom Ha wrote:

> does anyone know (for sure) how much data we can technically store in
> and later retrieve from a Rails session?

Why not store it in the database? The session object should only store a
tiny
bit of volatile context, such as the ID of the current user...

--
   Phlip
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-12-22 01:48
(Received via mailing list)
On Dec 22, 12:07 am, Tom Ha <rails-mailing-l...@andreas-s.net> wrote:
> Hi there,
>
> does anyone know (for sure) how much data we can technically store in
> and later retrieve from a Rails session?
>
It depends on the store. Cookies are limited to 4k (and that's base64
encoded, so you actually get about 3k of storage). Database stores are
only limited by whatever size limit the column used to store the data
has.
Big sessions are generally a bad idea though

Fred
4ddf8432a838f716cc499e43131e5e58?d=identicon&s=25 James Englert (Guest)
on 2008-12-22 02:39
(Received via mailing list)
Although I have idea, I would guess that you can store as much in rails
session as you want.  Your server probably won't like you much though.
460ead051b49c0b2a8e45e46252d4bda?d=identicon&s=25 Tom Ha (tom)
on 2008-12-22 07:00
Thank you !
This topic is locked and can not be replied to.