路由后,cakephp会话无法正常工作

时间:2013-12-26 05:56:35

标签: session routing cakephp-2.3

在我的cakephp应用程序中,我之后只使用了路由,在该路由页面中,cakephp会话无效...

这是我的代码:

Router::connect('/', array('controller' => 'Organizations', 'action' => 'view', 'orgname' => $orgname));

Then in the Organizations/view, the cakephp session is not working...

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我只是将以下代码放入路由控制器的操作中。

  App::uses('CakeSession', 'Model/Datasource');
    $value_user_id = CakeSession::read('LoggedSessionUserId');

然后我成功获得了会话值...