ID: 15428 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: Session related Operating System: FreeBSD PHP Version: 4.1.1 New Comment:
function check_session() { global $SEID, $lang, $vars; session_start($SEID); if( !(session_is_registered('lang')) ) { $lang='D'; session_register('lang'); } } check_session(); global $basket; if (!session_is_registered('basket') || $basket==null || $basket=="") { $basket=array(); session_register('basket'); } /* this funstion is used to store in a session data about every article, the call is always the same, but after a first call it saves data, on a second call it adds data to an array but does not update data in a session, on PHP 4.0.4 and 4.0.6 it works perfect under freeBSD and Linux */ function add() { global $art_name, $size, $qty, $model_number, $color, $customer_id, $maxqty, $ek_price, $vk_price, $program, $vars, $magras, $la_type, $program_n, $color_n, $season, $size_names, $lafirm, $collection_name; global $basket, $max_qtys; //walking in a busket for checking an existance of the same artikel $i=0; $exists=false; while(isset($basket[$i])) { $tmp=$basket[$i]; $ki=0; while($ki<7) { $tmpn="lab".$ki; global $$tmpn; if (check_digit($$tmpn) && $$tmpn!=0) { if($tmp['ID'] == $model_number && $tmp['size'] == $size_names[$magras][$ki] && $tmp['color'] == $color) { $basket[$i]['qty']+= $$tmpn; $exists = true; break; } } $ki++; } $i++; } if ($exists != true) { $ki=0; while($ki<7) { $tmpn="lab".$ki; global $$tmpn; if(check_digit($$tmpn) && $$tmpn != 0) { $qty_real=min($max_qtys[($size_names[$magras][$ki])], $$tmpn); $tmp=array( "ID" => $model_number, "name" => $art_name, "size" => $size_names[$magras][$ki], "qty" => $qty_real, "maxqty" => $max_qtys[($size_names[$magras][$ki])], "color" => $color, "program" => $program, "customer" => $customer_id, "ek_price" => "$ek_price", "vk_price" => "$vk_price", "magras" => $magras, "la"=>($ki+1), "program_n"=> $program_n, "color_n"=> $color_n, "agent" => $vars['username'], "season"=> $season, "collection"=>$lafirm, "collection_name"=>$collection_name ); array_push($basket, $tmp);//echo $tmp['ID']." ".$basket[1]['ID']; } $ki++; } } } //////////////////////////// ini params: [Session] ; Handler used to store/retrieve data. session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. session.save_path = /tmp ; Whether to use cookies. session.use_cookies = 0 ; Name of the session (used as cookie name). session.name = SEID ; Initialize session on request startup. session.auto_start = 0 ; Lifetime in seconds of cookie or, if 0, until browser is restarted. session.cookie_lifetime = 0 ; The path for which the cookie is valid. session.cookie_path = / ; The domain for which the cookie is valid. session.cookie_domain = ; Handler used to serialize data. php is the standard serializer of PHP. session.serialize_handler = php ; Percentual probability that the 'garbage collection' process is started ; on every session initialization. session.gc_probability = 3 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime = 1440 ; Check HTTP Referer to invalidate externally stored URLs containing ids. session.referer_check = ; How many bytes to read from the file. ;session.entropy_length = 0 ; Specified here to create the session id. ;session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom ; Set to {nocache,private,public} to determine HTTP caching aspects. session.cache_limiter = nocache ; Document expires after n minutes. session.cache_expire = 180 ; use transient sid support if enabled by compiling with --enable-trans-sid. session.use_trans_sid = 1 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" Previous Comments: ------------------------------------------------------------------------ [2002-02-07 21:14:02] [EMAIL PROTECTED] Short complete script and session realated ini settings are needed. Could you post them here? ------------------------------------------------------------------------ [2002-02-07 09:14:50] [EMAIL PROTECTED] When I try to save in the session variable, which is an array and every line of an array is HASH it allows to save ONLY first line (array[0]) later calling the same function in the same script with new data changes an array in memory, but after the script is finished - no new data stored in session, but session file is updated (time). When I install PHP 4.0.4 under WIN2000 - everything works good, also the same scripts works good under Linux with php 4.0.6, compiled options: './configure' '--enable-discard-path' '--with-ibm-db2=/usr/IBMdb2/V7.1' '--enable-ftp' '--enable-trans-sid' '--with-gd' '--enable-gd-native-tt' '--with-freetype-dir' '--with-png-dir' '--with-jpeg-dir' '--with-zlib-dir' for 4.1.1 under freeBSD options are: './configure' '--enable-discard-path' '--with-mysql=/usr/local' '--with-jpeg-dir=/usr/local' '--with-freetype' '--with-freetype-dir=/usr/local' '--with-png-dir=/usr/local' '--with-zlib' '--with-zlib-dir=/usr/local' '--enable-ftp' '--with-gd=/usr/local' '--enable-trans-sid' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15428&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php