【发布时间】:2009-07-17 04:18:24
【问题描述】:
我正在尝试使用我域中其他页面设置的 cookie 来验证用户身份。 假设我需要使用 cakephp 编写的 needpassword.example.com, 并且 cookie 由 auth.example.com 生成(使用 Perl CGI 程序)。
要登录needpassword.example.com,我需要重定向到auth.example.com 设置cookie,然后使用CakePHP 解析cookie。
如何解析这个 cookie?以及如何修改 Auth 组件来执行这些操作?
我怎样才能覆盖 Auth 类,而不是去 auth.example.com 进行身份验证,而不是使用 User 模型?通过覆盖 Auth.php 中的 identify 方法?
非常感谢。
【问题讨论】:
-
您是否检查过使用绝对 URL(即auth.example.com)设置 AuthComponent::loginAction 参数是否有效?
标签: cakephp cookies authentication