I'm using Kohana 3.3 and I'm trying to set a single unique cookie for every new site visitor. I'm doing it like this:

我正在使用Kohana 3.3,我正在尝试为每个新网站访问者设置一个唯一的cookie。我是这样做的:

if (!Cookie::get('unique_id'))
{
    Cookie::set('unique_id', uniqid(), 9990000);
}

But when I visit my site with 'www.' in front of the domain it creates a second cookie with the same name, but different value. How can I fix this?

但是当我用“www”访问我的网站时在域前面,它创建了一个具有相同名称但价值不同的第二个cookie。我怎样才能解决这个问题?

1 个解决方案

#1


1

Found a solution. I had to edit the system/classes/Kohana/cookie.php file, and set a value on the $domain variable.

找到了解决方案。我必须编辑system / classes / Kohana / cookie.php文件,并在$ domain变量上设置一个值。

更多相关文章

  1. 什么是从我的PHP网站过滤无效的utf8?
  2. 《细说PHP》第一章 LAMP网站的构建---读书笔记
  3. 网站优化之PHPCMS如何开启伪静态
  4. (phpQuery)对网站产品信息采集代码的优化
  5. mysql主从同步报slave_sql_running:no的解决方案
  6. 保存在Java桌面应用程序应用程序和网站上使用的个人用户设置的最
  7. win7下Django的MySql安装,问题解决方案
  8. mysql 事物没提交导致事物一直运行解决方案
  9. 无法连接远程MySQL数据库的解决方案

随机推荐

  1. Linux/Android——input系统之 kernel层
  2. Android模拟SD卡实现方法解析
  3. 第三课:android数据相关---文件
  4. Android(安卓)表格布局的RadioButton
  5. Android中RelativeLayout各个属性 androi
  6. Android漏洞——将Android恶意代码隐藏在
  7. Android(安卓)性能优化之使用MAT分析内存
  8. 【Android每周专题】触摸屏手势
  9. Android Drawable Resources系列7:
  10. Titanium中Android模块开发指南(中文)