PDA

View Full Version : How to configure php.ini for Session?



nlmzh
11-10-2007, 09:43 AM
I use PHP session in my program.
session_start();
session_register('oEdu');
$oEdu = $_SESSION['oEdu'];
global $oEdu,$oDB;
$oEdu['Cook']['UserName'] = $oDB->f('UserName');

I found out the session does not work. (There is no problem on my programs because they are fine in the other hosting provider server)

Do I need to configure php.ini in the folder? How to configure for session?

Thanks,

sjlplat
11-11-2007, 08:03 AM
Try:




session_start();
$_SESSION['oEdu'] = "value of session here";

nlmzh
11-11-2007, 08:05 PM
Do you think it is a problem from difference between PHP5 and PHP4.
I met the following error on Hostmonster
Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0

But Even I enable register_globals, the session does not work yet.

sjlplat
11-12-2007, 01:53 AM
I've noticed some minor differences between PHP4 and PHP5 in the way sessions and mysql queries are handled. I haven't become familiar enough with PHP5 yet to know exactly what the differences are off-hand though. I usually troubleshoot them as I come across them.