久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='yMfDh'></small><noframes id='yMfDh'>

      <bdo id='yMfDh'></bdo><ul id='yMfDh'></ul>

      1. <tfoot id='yMfDh'></tfoot>

        <legend id='yMfDh'><style id='yMfDh'><dir id='yMfDh'><q id='yMfDh'></q></dir></style></legend>
      2. <i id='yMfDh'><tr id='yMfDh'><dt id='yMfDh'><q id='yMfDh'><span id='yMfDh'><b id='yMfDh'><form id='yMfDh'><ins id='yMfDh'></ins><ul id='yMfDh'></ul><sub id='yMfDh'></sub></form><legend id='yMfDh'></legend><bdo id='yMfDh'><pre id='yMfDh'><center id='yMfDh'></center></pre></bdo></b><th id='yMfDh'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yMfDh'><tfoot id='yMfDh'></tfoot><dl id='yMfDh'><fieldset id='yMfDh'></fieldset></dl></div>

        使用 Zend_Session::rememberMe 持久登錄

        persisted login with Zend_Session::rememberMe(使用 Zend_Session::rememberMe 持久登錄)
        <i id='aww7G'><tr id='aww7G'><dt id='aww7G'><q id='aww7G'><span id='aww7G'><b id='aww7G'><form id='aww7G'><ins id='aww7G'></ins><ul id='aww7G'></ul><sub id='aww7G'></sub></form><legend id='aww7G'></legend><bdo id='aww7G'><pre id='aww7G'><center id='aww7G'></center></pre></bdo></b><th id='aww7G'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='aww7G'><tfoot id='aww7G'></tfoot><dl id='aww7G'><fieldset id='aww7G'></fieldset></dl></div>
          <tbody id='aww7G'></tbody>

        • <tfoot id='aww7G'></tfoot>
            <bdo id='aww7G'></bdo><ul id='aww7G'></ul>

              <small id='aww7G'></small><noframes id='aww7G'>

                <legend id='aww7G'><style id='aww7G'><dir id='aww7G'><q id='aww7G'></q></dir></style></legend>
                • 本文介紹了使用 Zend_Session::rememberMe 持久登錄的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 Zend_Session 來管理我的用戶會話,并且我希望在我的應用程序中實現記住我"選項,以使用戶保持登錄狀態 2 周左右.

                  I'm using Zend_Session to manage my user sessions, and I was looking to implement a "Remember Me" option in my application to keep users logged in for 2 weeks or so.

                  我注意到 Zend_Session 已經有一個名為 Zend_Session::rememberMe 的內置函數,但是我不確定該函數邏輯是否正確使用作為持久登錄.

                  I've noticed that Zend_Session already has a built-in function called Zend_Session::rememberMe, however I'm not sure if that function logic is correct to use as a persisted login.

                  本質上,rememberMe 功能只是延長活動會話的到期日期,這意味著如果用戶使用記住我選項,他將在活動會話中保持登錄狀態 2 周.

                  Essentially, the rememberMe function just extend the active session expiration date, which means if the user use the remember me option, he'll stayed logged in for 2 weeks with an active session.

                  這帶來了兩個主要問題.

                  This brings up 2 major issues.

                  1. 我將會話存儲在數據庫中,這意味著所有這些非活動用戶都在我的會話表中存儲了 2 周.我有超過 5 萬個非活動會話,這影響了應用程序的性能.
                  2. 我想知道用戶是否在 24 小時不活動后回到網站,并重新驗證他的信息.由于他的會話保持開放,我無法確定他是在 1 小時還是 1 周后回來,因為他的活動會話 ID 相同.

                  我讀過,如果我想實現記住我的功能,我不應該為此使用會話 cookie,我應該創建另一個登錄 cookie"來記住散列的 user_id 和令牌.這是完整的解釋:什么是實現記住我"的最佳方式用于網站?

                  I've read that if I want to implement a remember me feature, I shouldn't use the session cookie for that, and I should create another "login cookie" to remember a hashed user_id and a token. here's the complete explanation: What is the best way to implement "remember me" for a website?

                  那么為什么zend框架提供這樣的功能,如果使用它會產生性能和安全問題?

                  So why does zend framework offers such a function, if using it can create performance and security issues?

                  推薦答案

                  +1 指出 Zend 的記住我"功能方法背后的主要缺陷.有些人不明白,無論會話處理程序是基于文件還是基于數據庫,當他們嘗試延長會話生命周期時都會受到懲罰.允許陳舊的會話在合理的時間范圍內持續存在是一個薄弱的解決方案,您最好實施您提供的鏈接中概述的自定義 cookie 解決方案.

                  +1 for noting the major flaw behind Zend's approach to the 'remember me' functionality. Some people don't understand there is a penalty to be had when they attempt to extend the session lifetime, regardless of the session handler being file or db based. Allowing stale sessions to persist beyond a reasonable time-frame is a weak solution and you are better off implementing a custom cookie solution outlined by the link you provided.

                  直接回答您的問題;誰知道.也許他們沒有考慮到許多用戶選擇數據庫會話處理的事實,并且認為在文件系統上堆積陳舊的會話 cookie 對性能沒有直接影響.

                  The direct answer to your question; who knows. Maybe they didn't consider the fact that many users opt for database session handling, and figured piling up stale session cookies on the filesystem had no direct impact on performance.

                  此外,如果您想跟蹤用戶是否回來并重新建立過時的會話,您可以在會話跟蹤表中添加一個updated_at"列.那么你會有兩個時間戳列;created_at 和 updated_at,這將幫助您做出此決定.

                  Also, if you wanted to track if a user came back and re-established a stale session, you could add a 'updated_at' column to your session tracking table. So then you would have two timestamp columns; created_at and updated_at, which would help you make this determination.

                  這篇關于使用 Zend_Session::rememberMe 持久登錄的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                  <small id='axFlS'></small><noframes id='axFlS'>

                      • <bdo id='axFlS'></bdo><ul id='axFlS'></ul>
                      • <legend id='axFlS'><style id='axFlS'><dir id='axFlS'><q id='axFlS'></q></dir></style></legend>

                          • <tfoot id='axFlS'></tfoot>
                          • <i id='axFlS'><tr id='axFlS'><dt id='axFlS'><q id='axFlS'><span id='axFlS'><b id='axFlS'><form id='axFlS'><ins id='axFlS'></ins><ul id='axFlS'></ul><sub id='axFlS'></sub></form><legend id='axFlS'></legend><bdo id='axFlS'><pre id='axFlS'><center id='axFlS'></center></pre></bdo></b><th id='axFlS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='axFlS'><tfoot id='axFlS'></tfoot><dl id='axFlS'><fieldset id='axFlS'></fieldset></dl></div>
                              <tbody id='axFlS'></tbody>
                          • 主站蜘蛛池模板: 久久综合一区二区 | 欧美精品久久久 | 在线播放国产一区二区三区 | 99中文字幕 | 精品不卡| 青青草中文字幕 | 91视频入口 | 91精品久久久久久久久久 | 91久久| 欧美一区二区黄 | 一级片成人 | 欧美精品在线视频 | 国产丝袜一区二区三区免费视频 | 一区二区福利视频 | 一区二区三区中文字幕 | 一个色在线| 国产一区免费视频 | 性做久久久久久免费观看欧美 | 久久久国 | 成人黄色网址大全 | 男女网站视频 | 欧美精品video | 福利一区二区在线 | 国产玖玖 | 精品一区电影 | v亚洲| 亚洲欧美另类在线 | 中文字字幕一区二区三区四区五区 | 在线观看av中文字幕 | 日韩中文字幕在线免费 | 精品国产伦一区二区三区观看方式 | 国产日韩一区二区三区 | 免费黄色大片 | 在线免费亚洲视频 | 精品国产黄a∨片高清在线 成人区精品一区二区婷婷 日本一区二区视频 | 日韩在线一区二区 | 中文字幕一区二区三区乱码图片 | a级大片免费观看 | 免费成人国产 | 一二三四在线视频观看社区 | 久久久久久国产精品久久 |