Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Deleting and then setting a cookie in the same request doesn't work

#4211

When first deleting and then setting a cookie during the same request, the cookie doesn't get set.

I've attached a patch against the current rails with a testcase replicating the error.

Got hit by it when trying to use restful authentication with Rails 3 - the cookie with the remember_token never gets set.

Reported by Mathias Biilmann · March 18th, 2010 @ 12:25 AM

State: committed
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Mathias Biilmann
    Mathias Biilmann

    Fixed it by deleting the key from @deleted_cookies whenever a cookie is set. Attached a patch with both the testcase and the fix - disregard the first patch...

    March 18th, 2010 @ 12:38 AM

  2. Repository
    Repository
    • State changed from new to committed

    (from [c8dd6f224c9345b7e95cc0203b636e49412b71dc]) Deleting and setting a cookie in the same request was broken

    Made sure to remove a cookie from @deleted_cookies when set

    [#4211 Deleting and then setting a cookie in the same request doesn't work state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
    http://github.com/rails/rails/commit/c8dd6f224c9345b7e95cc0203b636e...

    March 18th, 2010 @ 01:05 AM