[PHP] session don't work with php that have version more than 4.03pl1
I have problem about using session with php that have version newer than 4.03pl1. this is the test code. - test_session.php - ?php session_start(); session_register("abc"); print "\$PHPSESSID - $PHPSESSIDbr"; $abc = 1; ? A HREF="test_session2.php"test_session2/A --- result is: $PHPSESSID - 16529ad58656fc32ec826430b7b1e08b test_session2 -- test_session2.php -- ?php print "\$PHPSESSID - $PHPSESSIDbr"; print "\$abc - $abcbr"; ? --- result is: $PHPSESSID - 16529ad58656fc32ec826430b7b1e08b $abc - this is the configuration: Session Support enabled DirectiveLocal ValueMaster Value ---- session.auto_start Off Off session.cache_expire80 180 session.cache_limiternocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 00 session.gc_maxlifetime 14401440 session.gc_probability 1 1 session.name PHPSESSIDPHPSESSID session.referer_checkno value no value session.save_handler files files session.save_path /tmp/tmp session.serialize_handler php php session.use_cookies On Onbr clear=allhrGet Your Private, Free E-mail from MSN Hotmail at a href="http://www.hotmail.com"http://www.hotmail.com/a.br/p
Re: [PHP] session don't work with php that have version more than 4.03pl1
Hi, Try: session_start_start(); for a change. If you don't it will never work. Not even with versions older than 4.03pl1. RenzE. On Fri, Mar 23, 2001 at 07:03:37PM +0700, Weerapong Sirikanya wrote: I have problem about using session with php that have version newer than 4.03pl1. this is the test code. - test_session.php - ?php session_start(); session_register("abc"); print "\$PHPSESSID - $PHPSESSIDbr"; $abc = 1; ? A HREF="test_session2.php"test_session2/A --- result is: $PHPSESSID - 16529ad58656fc32ec826430b7b1e08b test_session2 -- test_session2.php -- ?php print "\$PHPSESSID - $PHPSESSIDbr"; print "\$abc - $abcbr"; ? --- result is: $PHPSESSID - 16529ad58656fc32ec826430b7b1e08b $abc - this is the configuration: Session Support enabled DirectiveLocal ValueMaster Value ---- session.auto_start Off Off session.cache_expire80 180 session.cache_limiternocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 00 session.gc_maxlifetime 14401440 session.gc_probability 1 1 session.name PHPSESSIDPHPSESSID session.referer_checkno value no value session.save_handler files files session.save_path /tmp/tmp session.serialize_handler php php session.use_cookies On Onbr clear=allhrGet Your Private, Free E-mail from MSN Hotmail at a href="http://www.hotmail.com"http://www.hotmail.com/a.br/p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session don't work with php that have version more than 4.03pl1
Oops Should be: session_start(); ofcourse, instead of session_start_start(); RenzE. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] session don't work with php that have version more than 4.03pl1
you have to register the variable after it is set, not before. also only register the variable once, dont keep re-registering it, some builds ie php-4.0.5 (snap) doesnt like re-registering vars (sometimes). ?php include_once('time.egn'); if ( isset($PHPSESSID) ) session_id($PHPSESSID); session_start(); if (!isset($HTTP_SESSION_VARS['SessionID'])) { $SessionID = mtime(); session_register('SessionID'); } $PHPSESSID = session_id(); $SID = "PHPSESSID=$PHPSESSID"; ? this is my session file, works great for me. -- Chris Lee [EMAIL PROTECTED] ""Weerapong Sirikanya"" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have problem about using session with php that have version newer than 4.03pl1. this is the test code. - test_session.php - ?php session_start(); session_register("abc"); print "\$PHPSESSID - $PHPSESSIDbr"; $abc = 1; ? A HREF="test_session2.php"test_session2/A --- result is: $PHPSESSID - 16529ad58656fc32ec826430b7b1e08b test_session2 -- test_session2.php -- ?php print "\$PHPSESSID - $PHPSESSIDbr"; print "\$abc - $abcbr"; ? --- result is: $PHPSESSID - 16529ad58656fc32ec826430b7b1e08b $abc - this is the configuration: Session Support enabled DirectiveLocal ValueMaster Value ---- session.auto_start Off Off session.cache_expire80 180 session.cache_limiternocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 00 session.gc_maxlifetime 14401440 session.gc_probability 1 1 session.name PHPSESSIDPHPSESSID session.referer_checkno value no value session.save_handler files files session.save_path /tmp/tmp session.serialize_handler php php session.use_cookies On Onbr clear=allhrGet Your Private, Free E-mail from MSN Hotmail at a href="http://www.hotmail.com"http://www.hotmail.com/a.br/p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]