[Seaside] persisting across redirect..

sergio_101 sergio.rrd at gmail.com
Mon Oct 1 14:45:40 UTC 2012


the way the facebook authorization scheme works is as follows:

1. on the first go round, facebook sends a POST with some data in it
   that needs to be parsed to pull an authorization code out of it.
2. if the app isn't authorized, i need to redirect to an authorization
   dialog to so that the user can authorize my app.
3. once the user does that, my app receives an oauth code, and i am on
   my way.

i have everything working, except, i am not sure where to store the
authorization code..

in my main component's renderOn, it looks to see if the a instance
variable 'oauthToken' is set. if not, it renders some javascript that
is really just a redirect to the facebook authorization screen.

once the app is authorized, 'oauthToken' is set to the correct value.

then, the authorization dialog sends the request BACK to the root
url..

everything works correctly..BUT.. on the second time back, the
redirect from facebook, it looks like it starts a brand new session
(there is a new instance of the main component created).

i was hoping that this would all be one session, and that i could just
set an instance variable once, and not even touch the session, but i
don't think this is going to happen. plus, it looks like i will be
firing up a new session on return anyway, so what i have saved in
session will be lost.

anyone have any ideas on how to cleanly persist this variable after
facebook's redirect?

-- 
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101


More information about the seaside mailing list