vincent chu
2009-Jan-21 22:36 UTC
[Facebooker-talk] Possible Bug in Facebooker''s Connect support (secure_with_cookies!) ?
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."
Mike Mangino
2009-Jan-22 00:26 UTC
[Facebooker-talk] Possible Bug in Facebooker''s Connect support (secure_with_cookies!) ?
Thanks! I pulled this in along with another fix from Kevin Lochner. I also bumped the version number to generate new gems. Mike On Jan 21, 2009, at 5:36 PM, vincent chu wrote:> 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." > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com