Todd Wade > Catalyst-Plugin-SwiffUploaderCookieHack > Catalyst::Plugin::SwiffUploaderCookieHack

Download:
Catalyst-Plugin-SwiffUploaderCookieHack-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Catalyst::Plugin::SwiffUploaderCookieHack - Hack to get session restored when Flash makes a HTTP request to your app.

DESCRIPTION ^

There is a major deficiency in the Flash http client. A sane browser plugin would collect cookies that exist in the context it was loaded from and include those cookies in the headers of any http requests it makes.

Flash dosen't always do this, and in the situations where it does the implementation is not optimal.

To work around this, on the client side add your Catalyst::Plugin::Session::State::Cookie's session id to the body of the http request keyed to your session's cookie name and use this plugin to get the session seamlessly restored.

USAGE ^

FancyUpload knows about this problem and will put cookies in the http request for you when it uploads a file if you ask it to. See the appendCookieData option at http://digitarald.de/project/fancyupload/.

Then load this plugin in to Catalyst like so:

     use Catalyst (
       ...
       'SwiffUploaderCookieHack',
       ...
       'Session',
       'Session::Store::DBIC',
       'Session::State::Cookie',
       ...
     );

Now your session will work seamlessly with Flash.

CAVEATS ^

If you try to use the app's Catalyst::Plugin::Session before this plugin runs, things aren't going to work. Try to reference it in the front of the use Catalyst(...) argument list so it runs early.

AUTHOR ^

Todd Wade <waveright@gmail.com>

COPYRIGHT & LICENSE ^

Copyright 2010 Todd Wade

This sofware is free software, and is licensed under the same terms as perl itself.

syntax highlighting: