插件应用
主题模板
讨论社区
问答
博客
学习文档
框架开发文档
模板开发文档
接口开发文档
教学视频文档
模板引擎文档
下载安装
在线演示
登录
/
注册
个人中心
我的订单
退出登录
讨论社区 /
日志 /
帖子详情
THINKPHP中设置session值保存登录状态
2022-07-28 14:14:58
130
{{single.collect_count}}
1. 使用session之前,先开启session。
- session_start()
2. 存储session值
- session_start();
- $_SESSION[‘access_token’]=‘caf2e61cd13ada99fc650e6908c7’;
3. 获取session值
- session_start();
- echo $_SESSION[‘access_token’];
4. 删除和销毁session
- 删除某个session值用unset($_SESSION[‘name’]);
- 删除所有session值用session_destroy();
上一页:
thinkphp#数据模型model返回的结果集取其数据数组
下一页:
【ThinkPHP5.1】如何引用extend的类库
回帖
全部回帖({{commentCount}})
{{item.user.nickname}}
{{item.user.group_title}}
{{item.friend_time}}
{{item.content}}
{{item.like > 0 ? item.like : '点赞'}}
{{item.comment_content_show ? '取消' : '回复'}}
删除
回帖
{{reply.user.nickname}}
回复
@{{reply.reply_user.nickname}}
{{reply.user.group_title}}
{{reply.friend_time}}
{{reply.content}}
{{reply.like > 0 ? reply.like : '点赞'}}
{{reply.comment_content_show ? '取消' : '回复'}}
删除
回帖
展开{{item.reply_count}}条全部回复
查看更多
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}
发帖
加入PHP技术QQ群
一个专属于OneKeyAdmin的技术交流平台,记录OneKeyAdmin开发者的成长与进步。
主题帖
6221
回帖数
143
{{userInfo.nickname}}
{{userInfo.group_title}}
{{userInfo.describe}}
文章
{{blog_count}}
回帖
{{blog_comment_count}}
收藏
{{blog_collect_count}}
登陆 /
注册
文章
-
评论
-
粉丝
-
热门帖子
1 WordPress Rest API 入门详解
2765
2 Thinkphp5.0 获取新增数据的ID
2742
3 thinkphp5 解决跨域问题
2296
4 Yandex企业邮箱注册
1980
5 PHP的exec()函数用法详解
1837
6 Thinkphp6 的 where 查询条件 and 和 or 的 操作
1835
7 thinkphp5使用数据库表锁
1624
8 Thinkphp如何查看当前是哪个版本?查看thinkphp当前版本号的三种方法
1621
9 thinkphp6 如何输出json数据
1580
10 h5网站模板_超全超实用的80个模板网站,我全部整理在这里了
1577