• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FreakAuth - keep session alive in flash-call (fancyupload)

Hi guys!

I'm trying to implement Fancyupload - a script for uploading files via flash, and by that getting progress bars on the transfers.

In my application I use FreakAuth for authentication.

How can I get the flash script accepted by FreakAuth?

I've been trying to supply the session ID via the url:

And getting the session_id like this:

I suspect that last line of being wrong, and in that case.. how can I retrieve the session id from FreakAuth?

When I print the contents of $_GET, it's empty. Might that be reason for this failing? In that case, how can I fix the issue then? Smile

$_GET is disabled in CI, try using

url: controller/action/session_id

and then access it with



function action($session_id){

ah.. good point, thanks! Smile

Any ideas how I can get FreakAuth to use this session id?

sorry, can't help you there, i haven't used freakauth.

I try to do the same thing. Has anyone found a solution to this matter?

I am getting my login form underneath when I try to upload the files....

@skinpennal can you post your PHP code in your fancyupload ? I dont know how to get it work.

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.

appendCookieData: true

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

$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:

// 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:
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!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.