On 29 Oct 2008, at 21:12, Shandy Nantz wrote:

>
> Frederick Cheung wrote:
>> On 29 Oct 2008, at 20:22, Shandy Nantz wrote:
>>
>>> logout? Thanks,
>>>
>> Not in a fool proof way. You could have a window's onClose fire off  
>> an
>> ajax request, but obviously that won't work if they have javascript
>> turned off, won't work if they just turn off their computer or if
>> their broadband dies, might not work if they quit their browser  
>> etc...
>>
>> Fred
>
> That's what I am trying to do by saying:
>
> onunload = "delete_cookie('user');
>
> The probablem is doesn't seem to be working. When I say  
> session[:user] =
> "blah" is the name of that cookie "user"?
>
No. There is a single cookie (the default name is something like  
app_session where app is the name of the application). The associated  
value is either a serialized ruby object containing the session (if  
you are using the cookiestore) or just some completely opaque id that  
rails can use to grab the session from the db/memcache/filesystem.  
(You could have worked some of this out just by looking in your  
browser's settings - you can list all cookies stored by your browser)

Fred

> If anyone is interested by delete_cookie fuunction looks like:
>
> function delete_cookie ( cookie_name )
> {
>  var cookie_date = new Date ( );  // current date & time
>  cookie_date.setTime ( cookie_date.getTime() - 1 );
>  document.cookie = cookie_name += "=; expires=" +
>    cookie_date.toGMTString();
> }
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
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