# Help debugging lost session (rails + facebook)

**URL:** <https://www.ruby-forum.com/t/help-debugging-lost-session-rails-facebook/143526>\
**Category:** Rails\
**Created:** [July 19, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/help-debugging-lost-session-rails-facebook/143526 "2008-07-19T23:45:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![djconcepcion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/57b2e6/32.png) [@djconcepcion](https://www.ruby-forum.com/u/djconcepcion)\
**Post date:** [July 19, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/help-debugging-lost-session-rails-facebook/143526/1 "2008-07-19T23:45:52Z")

</div>

I have an app that is simultaneously using restful\_authentication and  
rfacebook (0.9.8).  
(I can’t use facebooker because it is completely incompatible with many  
other modules).  
restful\_authentication works just fine along side those logging in using  
facebook on the external site…  
where things go south is within the facebook canvas, but I think this is  
a rails session problem, hence I am posting here for help.

I get a callback showing facebook login worked:  
Processing SessionsController#create\_from\_facebook [GET]  
Session ID: ZZZ  
Parameters: {“fb\_sig\_time”=\>“1216501629.9969”,  
“fb\_sig\_in\_iframe”=\>“1”, “fb\_sig”=\>“e5e413db3e28e76053e6cb29e004e  
94c”, “action”=\>“create\_from\_facebook”, “fb\_sig\_session\_key”=\>“yyy-xxx”,  
“controller”=\>  
“sessions”, “fb\_sig\_expires”=\>“0”, “fb\_sig\_added”=\>“1”,  
“fb\_sig\_api\_key”=\>“”, “fb\_  
sig\_profile\_update\_time”=\>“1215049916”, “fb\_sig\_user”=\>“xxx”}  
\*\* RFACEBOOK INFO: Activated session from inside the canvas (user=xxx,  
session\_key=yyy-xxx, expires=0)

the user\_id is stuffed into the current session at this point, and  
current\_user is set.

the app then redirects, and it appears the session is completely  
switched (and lost) - i.e. at least the user\_id stored is gone, and the  
app gets into a infinite loop of redirecting back to login:

\*\* RFACEBOOK INFO: Regular redirect\_to  
\*\* RFACEBOOK INFO: Regular redirect\_to  
Redirected to [http://themainsiteindex](http://themainsiteindex)  
\*\* RFACEBOOK INFO: persisting Facebook session information into Rails  
session  
Completed in 0.00265 (377 reqs/sec) | DB: 0.00081 (30%) | 302 Found

Processing Controller#index [GET]  
Session ID: NOT ZZZ ?  
Parameters: {“action”=\>“index”, “controller”=\>“Controller”}  
\*\* RFACEBOOK INFO: Regular redirect\_to  
\*\* RFACEBOOK INFO: Regular redirect\_to  
Filter chain halted as  
[#\<ActionController::Filters::ClassMethods::SymbolFilter:0x249b3c4  
@filter=:login\_required\>  
] rendered\_or\_redirected. \<= failure is almost certainly due to the  
session (and session[:user\_id] being wiped out).

Note: if one logs in externally, and then goes to the internal app, it  
works, which is very strange.

What is wrong, or how do I debug who is wiping out/changing my session?
