<legend id='JwFnK'><style id='JwFnK'><dir id='JwFnK'><q id='JwFnK'></q></dir></style></legend>

    <tfoot id='JwFnK'></tfoot>

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

  1. <i id='JwFnK'><tr id='JwFnK'><dt id='JwFnK'><q id='JwFnK'><span id='JwFnK'><b id='JwFnK'><form id='JwFnK'><ins id='JwFnK'></ins><ul id='JwFnK'></ul><sub id='JwFnK'></sub></form><legend id='JwFnK'></legend><bdo id='JwFnK'><pre id='JwFnK'><center id='JwFnK'></center></pre></bdo></b><th id='JwFnK'></th></span></q></dt></tr></i><div id='JwFnK'><tfoot id='JwFnK'></tfoot><dl id='JwFnK'><fieldset id='JwFnK'></fieldset></dl></div>

    • <bdo id='JwFnK'></bdo><ul id='JwFnK'></ul>

      Yii2:为什么 User 类中的 auth 键是?

      时间:2023-08-18

        <tfoot id='VCzZI'></tfoot>

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

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

              <i id='VCzZI'><tr id='VCzZI'><dt id='VCzZI'><q id='VCzZI'><span id='VCzZI'><b id='VCzZI'><form id='VCzZI'><ins id='VCzZI'></ins><ul id='VCzZI'></ul><sub id='VCzZI'></sub></form><legend id='VCzZI'></legend><bdo id='VCzZI'><pre id='VCzZI'><center id='VCzZI'></center></pre></bdo></b><th id='VCzZI'></th></span></q></dt></tr></i><div id='VCzZI'><tfoot id='VCzZI'></tfoot><dl id='VCzZI'><fieldset id='VCzZI'></fieldset></dl></div>
              <legend id='VCzZI'><style id='VCzZI'><dir id='VCzZI'><q id='VCzZI'></q></dir></style></legend>
                <tbody id='VCzZI'></tbody>

                本文介绍了Yii2:为什么 User 类中的 auth 键是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                正如标题阐明了为什么在Yii2中引入了auth key?它的主要用途是什么以及它在身份验证中的用途是什么?

                As the title clarifies why is the auth key introduced in Yii2? What're it's main usages and how it is useful in authentication?

                推荐答案

                主要用途是通过 cookie 对用户进行身份验证.当您选择在登录时被记住时,这就是您被记住的方式.系统必须以某种方式识别和登录您.它可以将您的用户名和密码保存在 cookie 中(那是不安全的),或者它可以通过其他方式记住您.这是手段之一.登录到 Yii 应用程序后,查看它创建的 _identity cookie,您将看到 auth_key 是 cookie 的一部分.

                The main use is to authenticate the user by cookie. When you choose to be remembered at Login, this is how you are remembered. The system has to identify and login you somehow. It can either save your username and password in a cookie (that would be unsafe) or it can remember you by other means. This is one of the means. After you login into your Yii application take a look at the _identity cookie that it creates, You will see that the auth_key is part of the cookie.

                cookie 实际上记住了 $id、$authKey 和 $duration,idauth_key 组合比用户名/密码组合更安全.

                The cookie actually remembers the $id the $authKey and the $duration, an idauth_key combination is safer to remember then a username/password one.

                这篇关于Yii2:为什么 User 类中的 auth 键是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:yii 中的多模型表单 下一篇:如何在 Yii 中禁用 Ajax 请求上的 jQuery 自动加载?

                相关文章

                1. <i id='Xt5JU'><tr id='Xt5JU'><dt id='Xt5JU'><q id='Xt5JU'><span id='Xt5JU'><b id='Xt5JU'><form id='Xt5JU'><ins id='Xt5JU'></ins><ul id='Xt5JU'></ul><sub id='Xt5JU'></sub></form><legend id='Xt5JU'></legend><bdo id='Xt5JU'><pre id='Xt5JU'><center id='Xt5JU'></center></pre></bdo></b><th id='Xt5JU'></th></span></q></dt></tr></i><div id='Xt5JU'><tfoot id='Xt5JU'></tfoot><dl id='Xt5JU'><fieldset id='Xt5JU'></fieldset></dl></div>
                  • <bdo id='Xt5JU'></bdo><ul id='Xt5JU'></ul>
                  <legend id='Xt5JU'><style id='Xt5JU'><dir id='Xt5JU'><q id='Xt5JU'></q></dir></style></legend>

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

                2. <tfoot id='Xt5JU'></tfoot>