incomplete cookies
| From: | Greg Strockbine | Date: | Fri, 17 Nov 2000 16:07:37 +0000 |
| Subject: | incomplete cookies | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25914@lists.php.net to get a copy of this message | ||
I've been trying to write a very
simple php program using "session" commands.
I was following a tutorial, even 2 tutorials and
I can't get session variables to work. When I examine
the session file created in /tmp or do a session_encode(),
what I see is this:
!product1|!product2
the value of count itself is never saved.
I'm beginning to think I have a build problem.
I'm running debian linux, php4, apache. I built php4 with
--enable -track-vars.
I've placed session_start() as the first thing in my program,
before the <html> tag. I was following a tutorial at www.devshed.com.
I read all the user comments, I've been to the FAQ, I've consulted
other books, I've tried writing other similar demo programs.
I get no warning messages or errors.
My cookies always come out incomplete.
I'm trying to learn php, so far its about 10x harder than perl. :-)
Any suggestions? My program is below.
greg strockbine
=====================================================
<?php
session_start();
?>
<html>
<head>
<title>Listing 20.2 Registering variables with a session</title>
</head>
<body>
<?php
session_register("product1");
session_register("product2");
$product1 = "Sonic Screwdriver";
$product2 = "HAL 2000";
print session_encode();
print "<br>The products have been registered";
?>
</body>
</html>