Msg#: 3930079 posted 3:40 am on Jun 10, 2009 (gmt 0)
I have a skeleton php page that loads other php pages as includes into the page. I have session_start declared at the very beginning of this skeleton page and the site has complete access to these session variables in all the pages that I have ever called in the site.
Now, however, I have started to mess with ajax calls to other php pages that do some of the form processing, and I am having some trouble accessing the session variables. I am simply trying to set session variables in the ajax php pages and then access them back in the main php pages.
I tested it for a while and first came to the conclusion that I just couldn't get the session variables to set or access them if I set them in the ajax php files. However I finally figured out that they weren't setting in the ajax php files because I hadn't redeclared session_start in that page. So, when I redeclare that method, I can set the variable and I can then load one of the main pages and I can access the variable. However, now I have a new problem in that I am declaring this second session_start from an ajax call after the main page has already been sent to the browser and so I get header errors saying content has already been sent. So, I am stuck. If I don't call the second session_start, I don't have access the variables. If I do, I get header errors.