# Problem with session cookie expire time

**URL:** <https://www.ruby-forum.com/t/problem-with-session-cookie-expire-time/48432>\
**Category:** Rails\
**Created:** [November 20, 2005, 3:40pm UTC](https://www.ruby-forum.com/t/problem-with-session-cookie-expire-time/48432 "2005-11-20T15:40:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@andreas](https://www.ruby-forum.com/u/andreas)\
**Post date:** [November 20, 2005, 3:40pm UTC](https://www.ruby-forum.com/t/problem-with-session-cookie-expire-time/48432/1 "2005-11-20T15:40:49Z")

</div>

Hi,

I have set the cookie expire time to 1 year, and Rails seems to send the  
correct header line:  
Set-Cookie: \_session\_id=ffd03d0308c0b5059b9e13448468d91c; path=/;  
expires=Mon, 20 Nov 2006 20:32:02 GMT

Still every time I quit Firefox the cookie is gone, and in the cookie  
list in the preferences it says “valid until end of session”.

Any idea why this happens?

Thanks  
Andreas

---

<div class="post-metadata">

**Author:** ![andreas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@andreas](https://www.ruby-forum.com/u/andreas)\
**Post date:** [November 21, 2005, 9:03am UTC](https://www.ruby-forum.com/t/problem-with-session-cookie-expire-time/48432/2 "2005-11-21T09:03:32Z")

</div>

On 20.11.2005, at 16.40, Andreas S. wrote:

> Any idea why this happens?

Because it’s a session, not a normal cookie. According to this thread  
they are always stored in memory and thus only persistent inside a  
single browser _session_: [http://article.gmane.org/](http://article.gmane.org/)  
gmane.comp.lang.ruby.rails/11288/

//jarkko

---

<div class="post-metadata">

**Author:** ![andreas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ee7513/32.png) [@andreas](https://www.ruby-forum.com/u/andreas)\
**Post date:** [November 25, 2005, 11:59am UTC](https://www.ruby-forum.com/t/problem-with-session-cookie-expire-time/48432/3 "2005-11-25T11:59:23Z")

</div>

jarkko wrote:

> On 20.11.2005, at 16.40, Andreas S. wrote:
> 
> > Any idea why this happens?
> 
> Because it’s a session, not a normal cookie.

No, it’s a regular cookie with an expire time:  
Set-Cookie: \_session\_id=ffd03d0308c0b5059b9e13448468d91c; path=/;  
expires=Mon, 20 Nov 2006 20:32:02 GMT

It’s working now, probably was some weird problem with my browser.
