当前位置:网站首页>【PHP】将 SESSION 数据保存到 Redis
【PHP】将 SESSION 数据保存到 Redis
2022-07-26 18:38:00 【知其黑、受其白】
阅读目录
1、修改 php.ini
//设置存储类型
session.save_handler = redis
//redis链接 有密码添加?auth=123456
session.save_path = "tcp://127.0.0.1:6379?auth=123456"
//设置自动启动session
session.auto_start = 1
2、保存后重启 apache/nginx
3、链接 redis 客户端查看数据:
4、PHP测试:获取到所有的 session 值
<?php
print_r($_SESSION);
Array
(
[token边栏推荐
- Pyqt5 rapid development and practice 3.6 packaging resource files
- Advantages of advanced anti DDoS IP in Hong Kong and which industries are suitable for use
- 手机app测试用例怎么写?手机app测试点有哪些?
- The authentication type 10 is not supported
- 带你熟悉云网络的“电话簿”:DNS
- TB 117-2013 US Federal mandatory regulations
- EN 1504-6 products for protection and repair of concrete structures - reinforcement anchorage - CE certification
- Uiobject2 of uiautomator2 common classes
- PADS画2.54mm排针
- Openstack virtual machine network card is renamed cirename0
猜你喜欢

2022 build enterprise level data governance system

Linear algebra Chapter 4 linear equations

C language - Introduction - syntax - string (11)

Advantages of advanced anti DDoS IP in Hong Kong and which industries are suitable for use

Detailed explanation of call function in solidity

Aof & RDB of J2 redis

Pycharm加载conda创建pytorch虚拟环境报错,在conda命令行正常

2022/07/26 学习笔记 (day16) 抽象与接口

J3: redis master-slave replication

测试面试题集-UI自动化测试
随机推荐
Pads draw 2.54mm row needle
"Weilai Cup" 2022 Niuke summer multi school training camp 1
Redis介绍
CONDA transfer project virtual environment essential skills +pip speed download too slow solution
EN 1504-7 products for protection and repair of concrete structures corrosion prevention of reinforcement - CE certification
MySQL tutorial: MySQL database learning classic (from getting started to mastering)
Principle analysis and source code interpretation of service discovery
conda+pytorch环境教程
周末看点回顾|数字人民币产业联盟成立;中国移动宣布:和飞信将停止服务…
DDL,DQL,DML语句
利用MySQL主从复制延迟拯救误删数据
配置服务器环境
Selenium+Web自动化框架的Case
J3: redis master-slave replication
6种方法帮你搞定SimpleDateFormat类不是线程安全的问题
Uiobject2 of uiautomator2 common classes
Volatile keyword of JVM memory model
聊聊如何用 Redis 实现分布式锁?
The authentication type 10 is not supported
PADS画2.54mm排针