CodeIgniter删除我的cookie [英] CodeIgniter deleting my cookies

查看:64
本文介绍了CodeIgniter删除我的cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CodeIgniter的 ci_session 之外创建了一个cookie,但是每次CodeIgniter会话到期时,它也会删除我的cookie.反正有没有破坏我的cookie?

I created a cookie outside of CodeIgniter's ci_session but every time the CodeIgniter session expires, it deletes my cookie as well. Is there anyway to NOT destroy MY cookie?

我是CodeIgniter的初学者,并且会话类引用无法回答我的问题.

I'm a beginner with CodeIgniter and the session class reference doesn't answer my question.

setcookie($ name,$ value,$ expire);

我为它设置了一个不同的到期值,但仍然与CodeIgniter的 ci_session 相同.

I'm setting it with a different expiration value but still expires the same as CodeIgniter's ci_session.

当我使用 $ _ SESSION 时,也会发生同样的情况.

The same happens when I use $_SESSION.

推荐答案

我不是使用Cookie和CodeIgniter进行会话,而是使用PHP的文件系统功能.这样,我创建的"cookie和会话"将不会与CodeIgniter相同(或被删除).

Instead of using cookies and sessions with CodeIgniter, I used filesystem functions of PHP. This way, the "cookies and sessions" I created won't expire the same as (or get deleted by) CodeIgniter.

这篇关于CodeIgniter删除我的cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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