【发布时间】:2015-04-21 08:59:04
【问题描述】:
是否可以仅使用用户名或类似名称设置 cookie 和会话?
$_SESSION['username'] = $row['username'];
setcookie('username', $row['username'], time() + (60 * 60 * 24 * 30));
【问题讨论】:
-
@jawed:是的,为什么不可以在会话和 cookie 中设置任何你想要的东西