Posted by Geoff Berrow on 09/04/05 17:28
I noticed that Message-ID: <hBBSe.3225$7p1.3015@newsfe7-win.ntli.net>
from toedipper contained the following:
>
>I have the code below which logs a visitor to my site via logging the
>session id and other details in a table.
We've just had this. Why are you storing the session ID? Simply set a
session variable to true at the beginning of the session, check for it
before you write to the database, then set the session variable to
false.
e.g.
session_start();
if(!isset($_SESSION['test'])){
$_SESSION['test']=true;
}
if($_SESSION['test']){
//write to database
$_SESSION['test']=false;
}
else{
//visitor already logged so do other stuff
}
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
[Back to original message]
|