upload_max_filesize in php.ini interferes with sessions?
Posted: Fri Apr 10, 2009 9:10 pm
Hello
I´m new in the community, I'm from México, so english is my second lenguague, so I hope I can explain myself correctly.
I'm having a very extrange problem regarding my login system (with sessions) and overwritting the php.ini to allow upload files larger than 2mb using a form. I red that I can change the upload_max_filesize using .htaccess, ini_set() or by php.ini. The first two option didn´t work out. The .htaccess give a 500 Internal Server Error and the ini_set() did nothing. So I made a php.ini and put the next line:
upload_max_filesize = 8M
I uploaded in my root folder and everything works just fine. I was allowed to upload my file. But then this weird thing happen:
I have a login form that uses sessions. The form is in the file "menu.php" and menu.php and I call this file using include(). So, when the php.ini is in the server, I can´t log-in to my page but just from the pages that are in a diferent directory than the index.php (wiki, admin). In all the other pages and folders, the login system works. If I log-in from the index page and then go to the wiki or admin directory I lost my session. And if I try to log-in from the Wiki page it just do nothing, no error, just the log-in form again. If i delete the php.ini everything works perfectly again.
Summary: I can log-in from all the pages and keep my session but if I go (or try to log-in) to the Wiki folder it appears that I´m not logged-in. The form and the script to log-in is the same in all pages, menu.php in the root folder.
So... is this make any sense? I really need to upload files larger than 2mb and, until now, this is the only way I've managed to do that but obv i need to fix this problem and to know if this thing are even related.
Thank you very much.
Samuel.
I´m new in the community, I'm from México, so english is my second lenguague, so I hope I can explain myself correctly.
I'm having a very extrange problem regarding my login system (with sessions) and overwritting the php.ini to allow upload files larger than 2mb using a form. I red that I can change the upload_max_filesize using .htaccess, ini_set() or by php.ini. The first two option didn´t work out. The .htaccess give a 500 Internal Server Error and the ini_set() did nothing. So I made a php.ini and put the next line:
upload_max_filesize = 8M
I uploaded in my root folder and everything works just fine. I was allowed to upload my file. But then this weird thing happen:
I have a login form that uses sessions. The form is in the file "menu.php" and menu.php and I call this file using include(). So, when the php.ini is in the server, I can´t log-in to my page but just from the pages that are in a diferent directory than the index.php (wiki, admin). In all the other pages and folders, the login system works. If I log-in from the index page and then go to the wiki or admin directory I lost my session. And if I try to log-in from the Wiki page it just do nothing, no error, just the log-in form again. If i delete the php.ini everything works perfectly again.
Summary: I can log-in from all the pages and keep my session but if I go (or try to log-in) to the Wiki folder it appears that I´m not logged-in. The form and the script to log-in is the same in all pages, menu.php in the root folder.
So... is this make any sense? I really need to upload files larger than 2mb and, until now, this is the only way I've managed to do that but obv i need to fix this problem and to know if this thing are even related.
Thank you very much.
Samuel.