简体   繁体   English

在CakePHP Auth中-有一种方法可以在所有需要身份验证的操作上强制使用https(但不能进行其他操作)

[英]In CakePHP Auth - is there a way to force https on all actions requiring Authentication (but not others)

Using CakePHP Auth, I want to have all actions that require being logged in to also be forced to use https. 使用CakePHP Auth,我希望所有需要登录的操作也被强制使用https。

Is this possible via a callback somehow? 是否可以通过回调进行某种方式?

Further info: I have admin routing in use as well as certain "member-only" actions. 进一步的信息:我正在使用管理员路由以及某些“仅会员”操作。 Using CakePHP 1.2 also. 也使用CakePHP 1.2。

Many thanks for any pointers on this. 非常感谢您对此提出任何建议。

版本2.x的新功能:SecurityComponent :: requireSecure()参见http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html

登录页面也必须通过HTTPS提供服务,并且您可能希望为登录用户提供secure会话cookie,因此在通过HTTP访问网站时不会传输该登录cookie(这意味着用户在浏览时不会显示为登录状态)通过HTTP)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM