Link to home
Start Free TrialLog in
Avatar of Jason C. Levine
Jason C. LevineFlag for United States of America

asked on

Firefox, Safari, Chrome dropping PHP session after action on iframe...but not IE

Hi folks,

I have an odd problem.  We are using sessions to hold login data and pass it around as needed.  One app we are using is FileChucker (http://encodable.com/filechucker/) which uses an iframe to upload one or more files.  

We are noticing that sometimes (not every time), Firefox, Chrome, and Safari will lose the initial session after uploading a file.  IE never loses its session.  If a user loses their session and re-logs in and uploads a new file, they do not lose the session.

Has anyone else run into this behavior?  Any ideas on what we should be looking for in the scripts?
Avatar of Altin Bardhi
Altin Bardhi
Flag of United Kingdom of Great Britain and Northern Ireland image

Normally IE gets the whole file paths (when we use JavaScript for example) while the other browsers only the file name (file security reasons). It can happen that the user could upload an image with spaces on file name. If this happens, you the image may be uploaded but you may not be able to get the expected results on other browsers than IE.

I hope this gives you some clues.

Regards
Avatar of Jason C. Levine

ASKER

Hi albacom,

The files are being uploaded just fine and we are testing with "normal" names (no spaces or punctuation aside from the .extension).

 
It looks like the session is being destroyed after the user uploads a file. Are you setting a lot of cookies? Some browsers don't hold more than 20 cookies. If you are passing complex data then it is best to use the database to hold the data. You can create random tables and destroy them after retrieving the data to the next page.
SOLUTION
Avatar of rdivilbiss
rdivilbiss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also if you are setting the session from the IFRAME, you can try to set a cookie instead. Make sure it is accesible from where you call it. (path='/') After setting the cookie you can always asign it back to the session and destroy the cookie. You can also try to use obb_start(); just after session_start();
Rod, thank you.  Passing that onto the devs and will make them try it.

albacom,

In PHP, setting a session sets a cookie anyway.  But we'll give it a whirl.
I only got that idea as sessions could expire if you close the page but cookies not unless you destroy them before their expiry time.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey guys,

Sorry for the radio silence.  We're still running with the suggestions and trying to get a consistently repeatable error/solution.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>Sessions are URL sensitive.  Who knew?

I knew that but like you said, so simple it would have never occurred to me.
>> I knew that

So why does IE not care about the URL?
One of my suggestions was:

->Make sure it is accesible from where you call it. (path='/')
Sorry just read your post above. Thats fine with me.