trevorturk / flash_cookie_session

Rails 3 cookie sessions can cooperate with Flash
79 stars 16 forks source link

do not overwrite cookie if it's already set #22

Closed troex closed 10 years ago

troex commented 10 years ago

In recent version of Firefox 28 with video flash based flowplayer session is correctly set when swf pulls file from server, so there is no need to set cookie and in that case flash_cookie_session just wipes session cookie which results in user being logged out from the site.

This change stops replacing cookie if it's already set, how ever a better solution would be to parse cookies and merge but that's another story.

trevorturk commented 10 years ago

Thanks. I updated the README to suggest installing from the github source so I can stop worrying about releasing new gem versions.

troex commented 10 years ago

Thanks for the pull, I don't really think it can break something, usually flash is used for some heavy uploading these days, we do so too but on the same side we use mp4 streaming though flash player.

Our content is subscription based so we "authorize" each stream play similar how upload works but our flash player sets cookie from javascript and passes to the stream correct headers - that was causing cookies being wiped.