Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
515 views
in Technique[技术] by (71.8m points)

php jwt 中如何保存和会话相关的数据?

php jwt 中如何保存和会话相关的数据?比如session中,和此次会话相关的数据可以保存到session中,下次直接可惜通过session再次取出使用。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

第一次请求的时候生成一个token返回,后面每次请求都带上这个token。和会话相关的数据可以把数据序列化或者json_encode,再把token和对应的数据保存起来即可(db,redis,文件都可以)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...