0

I have a CakePHP website with its login system using the Auth component. How do I check that a user is logged in when they are in a folder outside of Cakephp?

-App
-Webroot
-- Filemanager
-- Filemanager/config/config.php

I tried in this way, but I can't read the sessions of CakePHP

    <?php
    session_start();
    if($_SESSION["Auth"]) {
        header("location: /");

}

Notice: Undefined index: Auth in /Users/vnt/Sites/app/webroot/filemanager/config/config.php

4

2 に答える 2

1

以下は、外部サイトの cakephp セッション変数にアクセスするコードです。

if(isset($_COOKIE['CAKEPHP'])){
 session_id($_COOKIE['CAKEPHP']);
}
session_start();
echo $_SESSION['Auth']['User']
于 2014-10-28T06:34:00.560 に答える