Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7675 (closed defect: invalid)

Opened 2 years ago

Last modified 2 years ago

Cookies expiry time never being sent in headers

Reported by: defsdoor Assigned to: bitsweat
Priority: high Milestone: 1.2.3
Component: ActionPack Version: edge
Severity: critical Keywords: session expires
Cc:

Description

Cookies seem to have stopped working properly since upgrading to 1.2.2 Testing under Webrick but have the same results in my live mongrel/apache setup

Controller

class CookController < ApplicationController
  def index
    cookies[:test_cookie] = { :value => "This is a test cookie", 
      :expires => Time.now + 1.month }
  end
end

views/cook/index.rhtml

Test Complete

Logs

Cookie set: test_cookie=; path=/; expires=Fri, 30 Mar 2007 08:40:38 GMT

Firefox Live HTTP Headers

HTTP/1.x 200 OK 
Cache-Control: no-cache
Date: Wed, 28 Feb 2007 08:43:48 GMT
Content-Type: text/html; charset=utf-8
Server: WEBrick/1.3.1 (Ruby/1.8.5/2006-08-25)
Content-Length: 14
Set-Cookie: test_cookie=This+is+a+test+cookie; path=/;
Set-Cookie: _playpen_session_id=8b8ee189aa41cbef663c711d0b8994ca; path=/
Connection: close

Change History

02/28/07 12:03:41 changed by defsdoor

As an aside - this has been broken before and was fixed in my previous update (not sure what version that was to). I wonder if somehow the fix has been regressed.

(follow-up: ↓ 3 ) 03/02/07 10:13:57 changed by bitsweat

  • keywords set to session expires.
  • owner changed from core to bitsweat.
  • milestone changed from 1.x to 1.2.

(in reply to: ↑ 2 ) 03/07/07 22:43:25 changed by defsdoor

  • status changed from new to closed.
  • resolution set to invalid.

Replying to bitsweat:

I've no idea why but this is now working ok -

Set-Cookie: email_address=fred%40bloggs.com; path=/; expires=Thu, 08 Mar 2007 22:37:30 GMT

Haven't done an update or anything like that so I can only assume that something in the office setup is tampering with the cookies (maybe privoxy). I am at home atm and it it's fine. Sorry for wasting your time :/