[Facebooker-talk] Possible Bug in Facebooker's Connect support (secure_with_cookies!) ?

vincent chu vincentchu at gmail.com
Wed Jan 21 17:36:55 EST 2009


Facebooker folks ---

I was having trouble running the facebook-connect tutorial (
http://www.elevatedrails.com/articles/2009/01/02/announcing-facebooker-support-for-facebook-connect/
) --- I could log my test-account in, but I couldn't get a valid
facebook_session to show up.

I've traced the problem to Facebooker's "secure_with_cookies!" method
and realized that if the user happens to have an infinite session, his
'expires' cookie is set to "0", which means that Facebooker will think
that his cookie expired in 1969 -- hence no facebook_session for
anybody with a persistent session key.

I've gotten the tutorial to run successfully if I check for a
persistent session_key in the method:

return unless (Time.at(parsed['expires'].to_f) > Time.now) ||
(parsed['expires'] == "0")

Don't know if the method is written this way for a reason, but I
thought I'd let you all now anyway ...

Cheers,

Vince


----
Vincent Chu
Department of Applied Physics
Geballe Laboratory of Advanced Materials
McCullough Bldg. 318
476 Lomita Mall
Stanford, CA, 94305

vchu AT post.harvard.edu
vincentchu AT gmail.com

http://www.stanford.edu/~vincentc (homepage, updated sporadically)

Consider this:
"The smallest positive integer not definable in under eleven words."


More information about the Facebooker-talk mailing list