Hi there,
When I'm using cookies, I just set the cookie to any information I want:
<?
$loginUserName = $HTTP_POST_VARS[loginUserName];
setcookie ("CkUserName", $loginUserName, time()+14400, "/", ".myDomain.com",0);
?>
then if I want to retrieve that cookie, I just call it:
<?
$CkUserName = $HTTP_COOKIE_VARS["CkUserName"];
echo "$CkUserName";
?>
This is just Great, but if I want to use sessions, cause so many programmers advice me to use sessions instead of cookies, so:
Q. How can I convert the above 2 scripts, to use sessions instead of cookies? because I searched the php manual and I couldn't find the way.
When I'm using cookies, I just set the cookie to any information I want:
<?
$loginUserName = $HTTP_POST_VARS[loginUserName];
setcookie ("CkUserName", $loginUserName, time()+14400, "/", ".myDomain.com",0);
?>
then if I want to retrieve that cookie, I just call it:
<?
$CkUserName = $HTTP_COOKIE_VARS["CkUserName"];
echo "$CkUserName";
?>
This is just Great, but if I want to use sessions, cause so many programmers advice me to use sessions instead of cookies, so:
Q. How can I convert the above 2 scripts, to use sessions instead of cookies? because I searched the php manual and I couldn't find the way.