Mu and Facebooker, Together

Published on: 26 Oct 2009 | Comments

Problem + Code

In some recent client work, I ran into the issue of sharing a Facebook session between Mu and Facebooker. I found Mu to be quite handy for a really great, enjoyable experience with Connect on the front-end, while Facebooker powered the backend. I needed them to work together!

Mu is fairly new, so I couldn't find anyone who had done this yet, and ended up implementing it myself. The best part is that my solution requires no modification to the actual open source libraries themselves, and "just works."

First, the code. Then, an explanation.

How's it work?!

Simple: Facebooker reads certain cookies to setup a session, and we can hook into auth with Mu to set those cookies, which is what we do. It simply sets the cookies on login, and expires them on logout.

With the above code setup on in your JS, whenever you use Mu to login or logout, the proper cookies will be set and you'll immediately be able to access the Facebooker API on your backend as well.

Comments

blog comments powered by Disqus

Where to?

Recent Posts

Contact

The quickest way to contact me is via email. I check it many times per day.

picture