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"?
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 [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
-~----------~----~----~----~------~----~------~--~---