Well, upon logging in they'll either be dealing with a session or a cookie. Either way, however, placing a cookie isn't too difficult.
if ($_COOKIE["visitCookie"]) {
echo $_COOKIE["visitCookie"] . ', you have obviously been here before!';
} else {
$value = "Username, or something"
setcookie ('visitCookie', $value, time()+ "3600");
echo 'Message!';
}
So, the if checks for the cookie, and if it isn't there, it'll place one with a value and a time of an hour. You'll probably want to extend the time, as right now it'll delete itself after an hour. This'll be the easiest way to insert a cookie if you didn't write the login system, as you can just slap it on the page you want it to display from. Try to give the cookie a relatively unique name, as well.