Jump to content

Cookies for autologin


idire

Recommended Posts

you can set one by using the code:

 

setcookie("name you wat to give to cookie", "the information you want to store in the cookie", the time you want the cookie to exist in seconds);

 

so for example:

 

$name = 'idire';

setcookie("UsersName", $name, time()+3600);

 

you can read the cookie by using the code:

 

$_COOKIE['Name of the cookie'];

 

so for example

 

echo 'hello '.$_COOKIE['UserName'];

 

will show:

 

hello idire

 

good luck :)

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.