php.ini session.cookie_domain - 放置什么?

标签 php apache ubuntu dns

我应该在 php.ini 文件中的 session.cookie_domain 中添加什么内容?

我的域名是:https://www.domain.com(包含 https 和 www)

我看到人们只输入domain.com。如果我有 https 和 www,我应该输入什么?

这是我指的代码:

; The domain for which the cookie is valid.
; http://php.net/session.cookie-domain
session.cookie_domain =

最佳答案

  • domain.com 表示 //domain.com

  • .domain.com 表示 //domain.com,也表示 //www.domain.com//subdomain.domain.com

  • 如果您只想通过安全连接 (https) 发送 cookie,请启用 session.cookie_secure 选项。否则,即使您使用 http 协议(protocol),也会设置 cookie。

关于php.ini session.cookie_domain - 放置什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41335499/

相关文章:

mysql - 在 ubuntu 上使用 apache 和 passenger 运行 rails 应用程序

ubuntu - 为 hadoop 设置无密码 ssh

linux - 使用普通用户删除 www-data 拥有的文件

php - 在数据库中存储 MySQL 查询 (MySQL)

php - 使用变量从mysql获取数据

javascript - PHP 是否比 Nginx/Apache 更快地检查文件是否存在?

linux - Linux 系统监视器如何获取进程统计信息

php - 在我的本地服务器中用php模拟外部页面请求

php - Laravel 旧()不工作

linux - htaccess pcfg_openfile : unable to check htaccess file, 确保它是可读的并且 '/files/domain.com/public_html/images/' 是可执行的