Welcome Guest, Not a member yet? Register   Sign In
FreakAuth - keep session alive in flash-call (fancyupload)
#7

[eluser]alant[/eluser]
This isn't a FreakAuth problem.. it's just that Flash objects basically behave like separate browsers and so they lose the session that you want them to use.

FancyUpload provides a way of posting the ci_session..

The following will make FancyUpload play nicely with any sort of session-based stuff that you're doing with CI.

--

When you initialise Fancyupload, make sure that appendCookieData is set to true.

Code:
appendCookieData: true

Make sure that in your ci_session config, that you are NOT matching useragents:

Code:
$config['sess_match_useragent']    = FALSE; // Because Flash is being used

And then you need to change the sess_read function in the Session library. You should really do this by creating your own MY_Session library... add the following lines below the session cookie check:

Code:
// Has the session id been posted?
        // Used for when Flash is involved
        if ($session === FALSE) {
            $session = $this->CI->input->post($this->sess_cookie_name);
        }

So the beginning of the sess_read function will look like this:
Code:
function sess_read()
    {
        // Fetch the cookie
        $session = $this->CI->input->cookie($this->sess_cookie_name);

        // Has the session id been posted?
        // Used for when Flash is involved
        if ($session === FALSE) {
            $session = $this->CI->input->post($this->sess_cookie_name);
        }


Not sure if this is the best way to do it.. but it works for me!


Messages In This Thread
FreakAuth - keep session alive in flash-call (fancyupload) - by El Forum - 07-21-2010, 07:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB