I do understand that it is the syntax of cookie. Hope I am right.

http://php.flashwebhost.com/vineesh/...set_cookie.php

PHP Code:
<?
if(isset($_COOKIE['userName'])) {
echo '<h2 style="color:red">Hi ' . $_COOKIE[userName] . '!, welcome back.</h2>';
exit;
}


if(isset($_POST['userName']) && strlen($_POST['userName']) > 3) {
setcookie('userName', $_POST['userName'], time() + 3600);
echo '<h3 style="color:red">You may close the browser and re-login, I will remember your Name. </h3>';
} else {

echo '
<html>
<body style="background-color:#D9D9D9">
<form method="POST" action="">
<input type="text" name="userName">
<button type="submit">Click here</button>

</body>
</html>

';
}