PHP's session might be useful, but i'm not very familiar with it. I prefer to create my own as I have more control over it.
On the log in page, after you've verified user name and or password etc. give them a new SID:
$SID = md5 (unique (rand()));
Store the new SID in a database or in a cookie so you can determine if the SID is valid. Also, place the $SID in a hidden form field on each page.
Good luck.