Hi, I am new to the list so be kind. I have been messing with PHP 4 on a windows 2000 machine using apache and am having trouble getting sessions to run. Even in their basic form, everything I have read is very involved and all I am trying to do is the basics but it doesn't work. Can any one give me any hints. I have been through a tutorial and these are the basic scripts. session_register_var.php <? // set up a session session_start(); // declare a variable and give it a value $my_favourite_colour="blue"; // register the variable to the session session_register("my_favourite_colour"); // show a hyperlink to get to the next page echo "<A HREF='show_session_var.php'>Click here to go to the next page</A>"; ?> and show_session_var.php <? // continue using the session session_start(); // show the variable's value echo "My favourite colour is ... ".$my_favourite_colour; ?> My php.ini file session section looks like this [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 = c:/temp ; Whether to use cookies. session.use_cookies = 1
; Name of the session (used as cookie name). session.name = PHPSESSID ; 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 = c:\tmp ; 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 = 1 ; 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. ; HTTP_REFERER has to contain this substring for the session to be ; considered as valid. 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 ; trans sid support is disabled by default. ; Use of trans sid may risk your users security. ; Use this option with caution. ; - User may send URL contains active session ID ; to other person via. email/irc/etc. ; - URL that contains active session ID may be stored ; in publically accessible computer. ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. session.use_trans_sid = 0 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" Andrew Williams Sales Engineer people telecom Contacts: mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Direct Tel: (02) 9458 5861 Mobile: 0403 479 990 Reception: (02) 9458 5888 Facsimile: (02) 9458 5858 Customer Service: 1300 55 88 88 www.peopletelecom.com.au talk to people This e-mail and any attachments are confidential and may contain copyright material of people telecom Ltd or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. people telecom Ltd does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of people telecom Ltd.