A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearPHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload - page 1
User InfoPosts
PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#1
I am having trouble with a session id not being defined.

The session variable is being called on a page that a form posts to via an ajax/jquery query.

The session variable is called on every other page without a problem. The variable is set when a user logs in, and is checked by an auth.php file. The auth.php file finds the session variable just fine, however, the insert.php file spits out an error: "Undefined index: var....".

Is there a reason for a session variable to get lost?

EDIT:
I am calling session_start in my auth.php file. I get an error message if I try to start another session.

Is it possible that the session variable is not being found because the file is posted to via an ajax request?

EDIT/ANSWER:
I found out what was wrong. I was using a flash uploader, and sessions are lost when making an upload with flash. Oh what a night.

Thanks for all your help!

posted date: 2009-04-15 22:03:00


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-15 22:03:01


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#3
Is the page (insert.php( has session started? It may be the reason.Try to start it if the PHP setting is not set to auto start.session_start();I also find out print out the $_SESSION sometimes handy.print_r($_SESSION);From my experience, there is another possibility, which is the other file is called from different host/servername/IP number, which cause the session variables not found. Although this is quite remote possibility.In your case, try to check it out just in case.

posted date: 2009-04-15 22:06:00


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#4
If you redirect not include insert.php you have use session_start();, because session not existing in that page, as far as I know php sessions working only in one page without extra configuration.

posted date: 2009-04-15 22:10:00


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#5
When i call print_r($_SESSION);, I only get "Array()" returned.

posted date: 2009-04-15 22:31:00


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#6
I found out what was wrong. I was using a flash uploader, and sessions are lost when making an upload with flash.

posted date: 2009-04-15 23:32:00


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#7
If you found out whats wrong you should accept your own question as an answer =)

posted date: 2009-04-15 23:35:00


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#8
Most flash uploaders allow you to add additional parameters that are sent along with the upload. You can use this to add the session ID to the flash upload POST...

posted date: 2009-04-16 18:17:00


Re: PHP: Possible reasons for $_SESSION['var'] to be mysteriously undefined with flash upload#9
can you set your own answer to the preferred answer? :P

posted date: 2009-05-21 11:39:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.