$loginerInfo=$user->where("account='$userName' and password='$password'")->find();
cookie('loginerInfo',$loginerInfo,'expire=3600*30');
这样把cookie保存起来,但在html模板中如果我要直接得到用户名的内容要怎么写?
在线等高手来解答!
回复讨论(解决方案)
存cookie是先将内容编码,例如json_encode,然后读取的时候解码,例如json_decode,然后就直接在html模板中使用就好了。
怎么用啊?<{$_COOKIE['youzhiwang_loginerInfo']['name']}>我这样得不到值啊
<{$_COOKIE['loginerInfo']['name']}>