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!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to