Codeigniter的会话数据,他们只是Cookie? [英] Codeigniter's session data, are they just cookies?

查看:93
本文介绍了Codeigniter的会话数据,他们只是Cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将为我的登录系统使用Codeigniter的会话数据,但首先我想了解他们,所以我阅读了用户指南,从我的理解,Codeigniter的会话数据只是 cookies。

这是真的吗?这意味着如果用户禁用Cookie,他将无法使用Codeigniter的会话数据登录任何网站?

quoted:



Session类将每个用户的会话信息作为序列化(以及可选地加密的)数据存储在cookie中

这意味着我应该创建我自己的本地PHP会话数据,谁禁用cookies能够登录我的网站?或Codeigniter的会话数据不是只是Cookie?

解决方案

CodeIgniter的内置会话类使用cookie,但是,即使是PHP中的标准会话需要cookie。



因此,无论您选择哪个路由,CodeIgniter Session或标准会话,无论如何,如果用户没有启用Cookie,会话将无法工作。 / p>

CodeIgniter的Session类的优点是它自动加密数据以防止cookie被篡改,并允许你根据数据库验证cookie。


I'm going to use Codeigniter's session data for my login system, but first I wanted to understand them, so I read the user guide, and from what I understand, Codeigniter's session data are just cookies.
Is this true? which means if the user disables cookies he wont be able to login to any website using Codeigniter's session data?
quoted:

The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie
So that means I should create my own native PHP session data to make users who disable cookies able to login my website? or Codeigniter's session data are not just cookies?

解决方案

Yes, the CodeIgniter's inbuilt session class does use cookies, however, even the standard Sessions in PHP need cookies.

Thus, no matter which route you go, CodeIgniter Session, or the standard Session, either ways if the user does not have cookies enabled, Sessions won't work.

The advantage of CodeIgniter's Session class is it automatically encrypts the data as well to prevent cookie tampering, plus allows you to authenticate the cookie against a database.

这篇关于Codeigniter的会话数据,他们只是Cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆