PHP数据保存到cookie

数据保存到本地cookie:

[php]

$expiretime = time() + 365*24*60*60; //过期时间
setcookie("SessionAdminID",$row["id"],$expiretime, "/");
setcookie("SessionAdminUser",$row["UserName"],$expiretime, "/");
setcookie("SessionAdminLevel",$row["UserLevel"],$expiretime, "/");
setcookie("SessionAdminPermission",$row["UserPermission"],$expiretime, "/");

[/php]

调取cookie内容:

[php]$_COOKIE["SessionAdminID"][/php]

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注