# Will session object be send to the user browser each time a

**URL:** <https://www.ruby-forum.com/t/will-session-object-be-send-to-the-user-browser-each-time-a/53677>\
**Category:** Rails\
**Created:** [February 13, 2006, 6:02pm UTC](https://www.ruby-forum.com/t/will-session-object-be-send-to-the-user-browser-each-time-a/53677 "2006-02-13T18:02:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [February 13, 2006, 6:02pm UTC](https://www.ruby-forum.com/t/will-session-object-be-send-to-the-user-browser-each-time-a/53677/1 "2006-02-13T18:02:33Z")

</div>

Hi,

I thinsk the session object will never send to client,  
it stays at the server side. can some one tell me if  
I’m right?

also it is a good pratice to store data inside the  
session object???

Thanks you very much

Saiho

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[Yahoo Mail - Organized Email](https://mail.yahoo.com)**
>
> It's time to get stuff done with Yahoo Mail. Just add your Gmail, Outlook, AOL or Yahoo Mail to get going. We automatically organize all the things life throws at you, like receipts and attachments, so you can find what you need fast. Plus, we've got...

---

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [February 13, 2006, 6:18pm UTC](https://www.ruby-forum.com/t/will-session-object-be-send-to-the-user-browser-each-time-a/53677/2 "2006-02-13T18:18:42Z")

</div>

Saiho Y. wrote:

> Hi,
> 
> I thinsk the session object will never send to client,  
> it stays at the server side. can some one tell me if  
> I’m right?

You are right.

> also it is a good pratice to store data inside the  
> session object???

It depends on the size and type of the data, and the load of your  
server.

Don’t store large or critical data in the session. Store them in the  
database or fielsystem.  
Don’t store classes whose definition will change.

```
      Mage
```

---

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [February 13, 2006, 6:51pm UTC](https://www.ruby-forum.com/t/will-session-object-be-send-to-the-user-browser-each-time-a/53677/3 "2006-02-13T18:51:57Z")

</div>

On 2/13/06, Saiho Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I thinsk the session object will never send to client,  
> it stays at the server side. can some one tell me if  
> I’m right?

The session ID is sent to the client. The session object itself is not.

> also it is a good pratice to store data inside the  
> session object???

This is a pretty wide open question, with the simple answer being  
“store as little as possible in the session.” Generally you use it  
for storing user authenication state and messages that need to be  
passed between requests (i.e. the flash).

– James
