Hello there,
I am new to sessions, and i can't seem to get the logic.
I would like to keep track of what pages a user is going to.
if several users are on the site, how do i keep track of them?
I mean, look at the following code:
<?php
session_start();
// Use $HTTP_SESSION_VARS with PHP < 4.1
if ( !isset( $SESSION['count'] ) )
{
$SESSION['count'] = 0;
echo $SESSION['count'];
}
else
{
$SESSION['count']++;
echo $_SESSION['count'];
}
?>
I got this code from the forum, so what is does is, start a session, set the variable count as 0 if it does not exist, and if
it does, increase count by 1 and display it.
If you're using $_SESSION[], is there no need to register the
variable? because i've seen session_register('count') as well.
Anyway, let's say a user enters the site and gets a unique id through sessions. The next user will get another unique id from a new session. How do you know who is who when both users are surfing different pages on the site?
Ok, i could be completely wrong here, but like i said, i'm new to
sessions..
Any help would really be appreciated!
Fish