# Secure session cookie

**URL:** <https://www.ruby-forum.com/t/secure-session-cookie/117772>\
**Category:** Rails\
**Created:** [October 20, 2007, 1:58am UTC](https://www.ruby-forum.com/t/secure-session-cookie/117772 "2007-10-20T01:58:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [October 20, 2007, 1:58am UTC](https://www.ruby-forum.com/t/secure-session-cookie/117772/1 "2007-10-20T01:58:41Z")

</div>

Is there a way to mark the cookie that Rails uses to store the  
session-id as a secure cookie?

Thanks,  
Ray

---

<div class="post-metadata">

**Author:** ![nappin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f475e1/32.png) [@nappin](https://www.ruby-forum.com/u/nappin)\
**Post date:** [December 3, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/secure-session-cookie/117772/2 "2007-12-03T18:11:22Z")

</div>

Hello Raymond,

On Oct 20, 1:58 am, Raymond O’Connor \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> Is there a way to mark the cookie that Rails uses to store the  
> session-id as a secure cookie?

Modify the ‘session’ line in app/controllers/application.rb as  
follows:

session :session\_key =\> ‘\_myapp\_session\_id’, :session\_secure =\> true

Best,

–  
dubek
