用户会话和两个CakePHP应用程序在同一台机器上运行 [英] User sessions and two CakePHP applications running in the same machine

查看:180
本文介绍了用户会话和两个CakePHP应用程序在同一台机器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一台计算机上运行 2 CakePHP应用程序
两者都需要先前的注册才能访问它们,用户首先看到的是登录表单。

I have 2 CakePHP applications running on the same machine. Both of them need a previous registration to have access to them and the first thing users see is the login form.

我意识到,当我在其中一个登录时,我可以访问其他Web应用程序,而不需要我的凭据登录。 (这是不正确的)

I have realized that when I do login in one of them, then, I can access to the other web application without being asked for my credentials to login. (which is not correct)

在我的控制器的两个应用程序,我有这个拒绝访问没有以前登录。

In my Controllers of both applications I have this to deny access without a previous login.

public function beforeFilter(){
    parent::beforeFilter();

    $this->Auth->deny();
}

但这似乎无法正常工作,当我使用相同的浏览器,登录此应用程序之一。

But this seems not to work properly when I use the same browser and I do login in one of this applications.

为什么会发生这种情况?有没有办法解决这个问题?

Why is this happening? Is there any way to solve this?

谢谢。

推荐答案

这两个应用程序的cookiename和/或缓存前缀应该不同。

The cookiename and/or cache prefix should be different for both applications.

您可以在 core.php 文件

这篇关于用户会话和两个CakePHP应用程序在同一台机器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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