所有網頁 圖片 影片 地圖 新聞 網誌搜尋 Gmail 更多 »
最近造訪的群組 | 說明 | 登入
Google 網上論壇首頁
Auth Component does not logout via URL
目前本群組有太多主題設為優先顯示。要優先顯示這個主題,請將其他主題的這個選項取消。
在處理您的要求時發生錯誤。請再試一次。
標幟
  4 個訊息 - 全部摺疊  -  將全文翻譯為 已翻譯 (查看所有原文)
您要留言的群組是 Usenet 群組。在此群組留言,網際網路上的任何使用者將可以看到您的電郵地址。
您的回覆郵件尚未寄出。
您已成功留言
 
寄件人:
收件人:
副本:
後續追蹤對象:
新增副本 | 新增後續追蹤對象 | 編輯主旨
主旨:
驗證:
為了確認,請輸入您在以下圖片中看到的字元,或輸入您按下存取圖示時所聽到的號碼。 注意聽並輸入您聽到的號碼
 
Prof. No Time  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月2日, 上午11時03分
寄件人: "Prof. No Time" <libertylivingst...@gmail.com>
日期: Sun, 1 Nov 2009 19:03:50 -0800 (PST)
當地時間: 2009年11月2日(星期一) 上午11時03分
主旨: Auth Component does not logout via URL
Good day all,

Please, I have a little problem with my AUTH component. I am using the
default AUTH component in 1.2.5. I discovered that when I login to my
app and then try to log  out by typing the logout url: http://localhost/myapp/logout
(which is routed to myapp/users/logout), the auth component simply
refuses to logout (instead it gives me the deny message: You are not
authorized to bla bla bla...). It also presents me with the login form
to authorize me. The funniest part is that if I then enter my
credentials, I am then logged out. (Imagine entering username and
password to log out of an application, isn't that sickening?)

However, when I click on logout link from within a page, it logs out
correctly. What could be the cause of this?


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
robustsolution  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月2日, 下午10時29分
寄件人: robustsolution <i...@robustsolution.net>
日期: Mon, 2 Nov 2009 06:29:45 -0800 (PST)
當地時間: 2009年11月2日(星期一) 下午10時29分
主旨: Re: Auth Component does not logout via URL
Prof.No Time

try to take a coffee cup and get relaxed, this is my current solution/
tips/tricks for the moment

1)put this in your AppController class
final protected function _logout() {
        if (!empty($this->Cookie)) {
                //this ensures if you were using the Cookie component along with the
Auth component (the famous remember me checkbox)
                //and you have saved the credentials inside cookie
                //you should delete the credentials from the cookie when you log out
                //no need to verify if you have already saved the credentials inside
cookie, no error is thrown
                $this->Cookie->del($this->Auth->sessionKey);
        }
        return $this->Auth->logout();

}

2)your UsersController class logout() method should be now like this
public function logout() {
        $this->redirect($this->_logout());

}

3)your UsersController class beforeFilter() method/callback should be
now like this
public function beforeFilter() {
        ...
        parent::beforeFilter();
        //please specify the always allowed actions... logout should be the
first one of course
        $this->Auth->allow
('logout','forgotpassword','resetpassword','activate','register'/* put
here any other always-allowed action*/);
        if ($this->Auth->user()) {
                if (in_array($this->params['action'],array
('forgotpassword','resetpassword','register','activate'))) {
                        //if you are forgetting your password,
                        //if you resetting your password,
                        //if you are registering as a new user,
                        //or if you are activating you new accout via url
                        //you should not be logged in ... yea this is logic
                        $this->_logout();
                } elseif($this->params['action']=='login') {
                        //you are already logged in, no need to login again
                        $this->redirect($this->Auth->redirect());
                }
        } elseif ($this->params['action']=='logout') {
                //you are already logged out, no need to log out again
                $this->redirect($this->Auth->redirect());
        }
        ...

}

now have a nice baking day....

    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
Prof. No Time  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月4日, 下午11時40分
寄件人: "Prof. No Time" <libertylivingst...@gmail.com>
日期: Wed, 4 Nov 2009 07:40:24 -0800 (PST)
當地時間: 2009年11月4日(星期三) 下午11時40分
主旨: Re: Auth Component does not logout via URL
Thanks very very much RobustSolution, I have applied your logic. Its
ok though I didn't use the "famous" remember me here checkbox. I have
studied the issue and finally discovered that it is a fault of the
BUGGY INTERNET EXPLORER that keeps CACHING the page instead of
visiting the SERVER for proper details (Stupid Explorer!!!). Please
can you help me out on how to prevent caching of the LOGOUT page by
such browsers?

Cheers in ADV.

On Nov 2, 3:29 pm, robustsolution <i...@robustsolution.net> wrote:


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
robustsolution  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月6日, 上午6時51分
寄件人: robustsolution <i...@robustsolution.net>
日期: Thu, 5 Nov 2009 14:51:00 -0800 (PST)
主旨: Re: Auth Component does not logout via URL
m really sorry for the delay but I really misunderstood the question

I don't know if you mean this

http://book.cakephp.org/view/431/disableCache

On Nov 4, 3:40 pm, "Prof. No Time" <libertylivingst...@gmail.com>
wrote:


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
無其他留言
« 返回討論主題 « 較新的主題     較舊的主題 »

建立群組 - Google 網上論壇 - Google 首頁 - 服務條款 - 隱私權政策
©2009 Google