This project is archived and is in readonly mode.

#2485 ✓resolved
Vincent Danjean

Rails always resend the same cookie with active_record sessions

Reported by Vincent Danjean | April 12th, 2009 @ 07:20 PM | in 3.0.2

Hi,

I see that a rails application with active_record session storage always resend the same cookie to the web browser for each request. When using cookies session storage, one cookie is sent at the first connection but reloading the page (or going to another page) does not trigger the resending of the cookie.

Step to reproduce : 1) create an empty rails application 2) configure connection to database (if needed) 3) create a controller with a view 4) run WEBrick and use a browser (where you need to ack each cookie) => you get one cookie the first time you load the view page => you do not get a cookie any more if you reload the page (or if you go to another page) 5) enable ActiveRecord session: rake db:sessions:create rake db:migrate and edit config/environment.rb to enable it 6) run WEBrick and use a browser (where you need to ack each cookie) => you get the same cookie each time you load or reload a page !

I tested this behavior with rails 2.1 and 2.2 (not tested with rails 2.3) Can someone tell me how to avoid the resending of the same cookie with active_record session storage ?

Regards,

Vincent

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages