Session cookie doesn't work

From: Date: Mon, 26 Nov 2007 10:53:06 +0000
Subject: Session cookie doesn't work
Groups: php.general 
Request: Send a blank email to php-general+get-265019@lists.php.net to get a copy of this message
Hi, I'm working to use cookie to maintain session data across multiple pages in PHP4.42. I have the following two scripts, where I think the second file outputs a data in a session variable. file 1 - test_1.php ##################### <?php session_set_cookie_params(360 * 24 * 3600); session_start(); $_SESSION['name'] = "Kevn"; ?> <a href="test_2.php?<php? echo SID ?>">Go next</a> ########################################## file 2 - test_2.php ###################### <?php session_start(); echo $_SESSION['name']; // Here I expect to show the word "Kevin" ?> ########################################## phpinfo() tells me that * Session Support enabled * session.auto_start Off * session.bug_compat_42 On * session.bug_compat_warn On * session.cache_expire 180 * session.cache_limiter nocache * session.cookie_domain no value * session.cookie_path / * session.cookie_secure Off * session.entropy_file no value * session.entropy_length 0 * session.gc_divisor 100 * session.gc_maxlifetime 1440 * session.gc_probability 0 * session.name PHPSESSID * session.referer_check no value * session.save_handler files * session.save_path /var/lib/php4 * session.use_cookies On * session.use_only_cookies On * session.use_trans_sid On What am I missing? In file 1, I also tried "<a href="test_2.php>Go next</a> . I've been learning PHP using various books and websites. Still I don't solve this issue. Any help would be apprecaited.

« previous php.general (#265019) next »