IE7 Cookies not persisting. Please help.

I'm new to cookies and rails so I apologize for my ignorance. I'm
using Javascript to store persistent cookies using the following code
(taken from the O'Reilly Javascript book):

Cookie.prototype.store = function( daysToLive, path, domain, secure )
{
  var cookieval = "" ;

  for ( var prop in this )
  {
    // Ignore properties wiht names that begin with the '$' and also
methods
    if ( ( prop.charAt(0) == '$' ) || ( ( typeof this[prop]) ==
'function' ) )
      continue ;

    if ( cookieval != "" ) cookieval += '&' ;

    cookieval += prop + ':' + encodeURIComponent( this[prop] ) ;

  }
  var cookie = this.$name + '=' + cookieval ;

  if ( daysToLive || daysToLive == 0 )
  {
    cookie += "; max-age=" + (daysToLive*24*60*60) ;
  }

  if ( path ) cookie += "; path=" + path ;
  if ( domain ) cookie += "; domain=" + domain ;
  if ( secure ) cookie += "; secure" ;

  // Now store the cookie by setting the Document.cookie property
  document.cookie = cookie ;
}

This works fine in Firefox but in IE7 it seems to work like a session
cookie. As soon as I close the browser it doesn't exist.

I'm certain it's something in Rails that I'm missing.

Thanks in advance for the help!

A few more details:

- I don't have any other cookies for the domain
- There is not an underscore in the domain/subdomain
- My privacy setting are at their lowest (accept all cookies)
- The cookie is there and accessible until I close the browser and
restart
- I'm sure there's a simple Rails reason for all of this. I don't
want to have to persist the session to make this work, is that even
possible in Rails?

Thanks again.

Try the depricated expires attribute instead of max-age, which is not
supported by IE. expires differs from max-age in that it sets a date
(UTC) instead of a duration.