CodeIgniter Forums
Uploadify and CI 2.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Uploadify and CI 2.0 (/showthread.php?tid=39114)



Uploadify and CI 2.0 - El Forum - 03-01-2011

[eluser]Unknown[/eluser]
Hi

Im building this application where a user is able to upload his own pictures after he is logged in, im using Uploadify to handle the uploading and everything works fine in Mozilla Firefox and Google Chrome etc. but when it comes to IE8/7 it still uploads, but kills the session and logs out the user right after the upload is complete.
When i log back in the picture is updated and uploaded, but i want to avoid getting my session killed during the upload.

I've tried searching around for days for a solution or workaround but nothing works.
I set my session to be saved in the database and i tried putting the session in a cookie and restoring it again, but no luck (unless i did it wrong).

Any help is appreciated on how to avoid this problem...

Thanks


Uploadify and CI 2.0 - El Forum - 03-01-2011

[eluser]CroNiX[/eluser]
The problem is that uploadify is a flash app, which does not pass along the php session info and also has a different user agent string than the browser. If your session happens to change (which it does periodically using CI's sessions) on a request, you will get logged out because the session is gone because they no longer match. There are other workarounds on the forums if you search.


Uploadify and CI 2.0 - El Forum - 03-01-2011

[eluser]Cristian Gilè[/eluser]
http://ellislab.com/forums/viewthread/150550/


Cristian Gilè


Uploadify and CI 2.0 - El Forum - 03-02-2011

[eluser]Unknown[/eluser]
Found a solution that works,

In your config.php you can set your

Code:
$config['sess_match_useragent']= FALSE;

when doing this CI 2.0 atleast, won't create a new session for the flash object, and thus not kill your current session in IE.


Uploadify and CI 2.0 - El Forum - 03-23-2011

[eluser]beatryder[/eluser]
[quote author="Wakeydk" date="1299073425"]Found a solution that works,

In your config.php you can set your

Code:
$config['sess_match_useragent']= FALSE;

when doing this CI 2.0 atleast, won't create a new session for the flash object, and thus not kill your current session in IE.[/quote]

I think this only works in IE. Testing in FF and Chrome it doesn't work that way. In Chrome the flash plugin is completely separate from the rest of the page.