generating new session-id on every page
| From: | Terje With Lunndal | Date: | Mon, 06 Mar 2000 15:33:02 +0000 |
| Subject: | generating new session-id on every page | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11584@lists.php.net to get a copy of this message | ||
i fear that i have misunderstood something basic, but due to the
limitations in the docs for sessions in php4, i'll plead ignorgance and
post my problem :)
i have lots of problems with getting php4 to handle sessions correctly.
it seems that it generates a new SID every time.
my testpage is count.php and looks like this:
<?php
session_register("count");
$count++;
print '<html>';
print '<p>the counter is: '.$count.'</p>';
print '<p><a href="count.php">increment</a></p>';
print '</html>';
?>
now if i reload the page with the reload-button in Netscape, it acts
like i want it to, incrementing the counter. but if i press the link and
thus loads the document as a new one, it sets a new session cookie.
is there something i am missing out on here?
i am running FreeBSD 3.4-STABLE with Apache and php4b4pl1.
i compiled Apache as the "quick install" directions in the php4
INSTALL-file suggested. - no fancy stuff in the configure. only
--with-mysql and --enable-track-vars.
the session section of my php.ini looks like this:
[Session]
session.save_handler = files ; handler used to store/retrieve
data
session.save_path = /tmp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
session.use_cookies = 1 ; whether to use cookies
session.name = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start = 0 ; initialize session on request
startup
session.cookie_lifetime = 0 ; lifetime in seconds of cookie
; or if 0, until browser is
restarted
session.cookie_path = / ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
; php is the standard serializer of
PHP
session.gc_probability = 1 ; procentual probability that the
; 'garbage collection' process is
started
; on every session initialization
session.gc_maxlifetime = 1440 ; after this number of seconds,
stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
session.referer_check = 1 ; check HTTP Referer to invalidate
; externally stored URLs containing
ids
session.entropy_length = 0 ; how many bytes to read from the
file
session.entropy_file = ; specified here to create the
session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
; determine HTTP caching aspects
session.cache_expire = 180 ; document expires after n minutes
hope someone can enlighten me.
Terje
--
Terje With Lunndal
KPNQwest Norway