Session variables not accessible in subdirectory

强颜欢笑 提交于 2019-12-02 00:54:59

Ok, it appears that the problem occurred, in part, due to my lack of understanding of what putting my own php.ini in the public_html folder would do. Because we can't use ini_set() on our shared server (it's disabled) I created a local copy of php.ini that contained the following lines to override dud default settings...

date.timezone =  Australia/Melbourne
magic_quotes_gpc = Off

I assumed that the values in this local version of php.ini would simply override the values in the master php.ini.

Unfortunately this is not what happens on the Jumba / UberGlobal hosting. Creating this local php.ini meant that the entire configuration reverted to default values, except for these two settings.

The solution was for a tech from Jumba / Uberglobal to make a copy of their php.ini file (with just the above two values changed) and place it in our public_html folder.

This has fixed the problem.

Thanks for everyone's help!

I had a similar issue. I was able to fix it by making sure a copy of the php.ini file was present in every subdirectory that I want to access.

That should not occur... but ok. You can try one thing, create a file in the root and include it in all the files. That way you can run the session_start in that common file.

/common.php /file1.php (include common.php) /test/file2.php (include ../common.php - check paths and such)

and see if it still goes wrong.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!