在PHP中的PHPSESSID cookie上设置httpOnly并确保其安全 [英] Set httpOnly and secure on PHPSESSID cookie in PHP

查看:572
本文介绍了在PHP中的PHPSESSID cookie上设置httpOnly并确保其安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PHPSESSID cookie上设置httponly和安全标志的推荐方法是什么?

Whats the recommended way to set httponly and secure flags on the PHPSESSID cookie?

我发现 http://www.php.net/manual /en/session.configuration.php#ini.session.cookie-httponly .有更好的建议吗?

I found http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-httponly. Any better suggestions?

谢谢

推荐答案

我认为最好的方法是:

In my opinion the best would be: http://www.php.net/manual/en/function.session-set-cookie-params.php

void session_set_cookie_params ( int $lifetime [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]] )

这篇关于在PHP中的PHPSESSID cookie上设置httpOnly并确保其安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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