# Sessions

**URL:** <https://www.ruby-forum.com/t/sessions/180993>\
**Category:** Rails\
**Created:** [January 3, 2010, 5:46am UTC](https://www.ruby-forum.com/t/sessions/180993 "2010-01-03T05:46:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 3, 2010, 5:46am UTC](https://www.ruby-forum.com/t/sessions/180993/1 "2010-01-03T05:46:25Z")

</div>

The _Agile Web D. with Rails_ book has an explanation of  
sessions that I am having trouble following.

Does anyone know of another good discussion of how Rails manages  
sessions.

Specifically, in Firefox and and Internet Explorer … is each browser  
window a session? Is each invocation of the browser a session?

If I close a browser window … can I restart the session?

Exactly what is a session and how is state information maintained across  
browser requests?

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 3, 2010, 11:47am UTC](https://www.ruby-forum.com/t/sessions/180993/2 "2010-01-03T11:47:51Z")

</div>

On Jan 3, 4:46 am, Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Exactly what is a session and how is state information maintained across  
> browser requests?

A session is tied to a cookie (depending on your session store that  
cookie either contains the session data or an identifier that allows  
rails to retrieve the session from memcache/database/disk etc.) Your  
questions above all boil down to what is the scope of a cookie and how  
long does it last. Cookies can have expiry dates set long in the  
future, but sessions are handled with cookies that are set to only  
last until the browser quits (not the same as just closing a window).

Fred

Fred

> –  
> Posted viahttp://www.ruby-forum.com/.

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 3, 2010, 1:35pm UTC](https://www.ruby-forum.com/t/sessions/180993/3 "2010-01-03T13:35:14Z")

</div>

Cookies can have expiry dates set long in the

> future, but sessions are handled with cookies that are set to only  
> last until the browser quits (not the same as just closing a window).

Let’s say that I’m using Firefox and I open multiple instances of  
Firefox … so do all the instances of Firefox know about all the  
cookies?

When, exactly, does a cookie with no expiration date disappear?

Anyway, is there a more in-depth explanation available anywhere online  
that you can recommend?

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 3, 2010, 1:39pm UTC](https://www.ruby-forum.com/t/sessions/180993/4 "2010-01-03T13:39:04Z")

</div>

Hi Ralph,

start here:

> **[Action Controller Overview — Ruby on Rails Guides](https://guides.rubyonrails.org/action_controller_overview.html#session)**
>
> Action Controller OverviewIn this guide, you will learn how controllers work and how they fit into the request cycle in your application.After reading this guide, you will know: How to follow the flow of a request through a controller. How to...

Regards,  
Nicolai

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [January 3, 2010, 2:44pm UTC](https://www.ruby-forum.com/t/sessions/180993/5 "2010-01-03T14:44:38Z")

</div>

On Jan 3, 12:35 pm, Ralph S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Cookies can have expiry dates set long in the
> 
> > future, but sessions are handled with cookies that are set to only  
> > last until the browser quits (not the same as just closing a window).
> 
> Let’s say that I’m using Firefox and I open multiple instances of  
> Firefox … so do all the instances of Firefox know about all the  
> cookies?

Try it!

Fred

> When, exactly, does a cookie with no expiration date disappear?
> 
> Anyway, is there a more in-depth explanation available anywhere online  
> that you can recommend?
> 
> –  
> Posted viahttp://www.ruby-forum.com/.

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
