加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Symfony 2安全性:不断从用户提供商重新加载数据?

发布时间:2020-12-13 17:29:49 所属栏目:PHP教程 来源:网络整理
导读:当用户已经登录时,Security组件会每个reqyest继续从用户提供商重新加载数据.有没有办法避免这种情况?当您的用户提供程序不在本地数据库中时,例如,在Web服务中,这可能会使系统大大减慢. 在每一个请求我得到这个: [2012-08-15 20:07:30] security.DEBUG: Rea
当用户已经登录时,Security组件会每个reqyest继续从用户提供商重新加载数据.有没有办法避免这种情况?当您的用户提供程序不在本地数据库中时,例如,在Web服务中,这可能会使系统大大减慢.

在每一个请求我得到这个:

[2012-08-15 20:07:30] security.DEBUG: Read SecurityContext from the session [] []
[2012-08-15 20:07:30] security.DEBUG: Reloading user from user provider. [] []
根据您的需要,您可以根据您的需要,为每个请求刷新用户,以覆盖从给定的安全上下文中依赖的UserProviderInterface实现的refreshUser方法.

请参阅以下API文档:

UserProviderInterface.html#method_refreshUser

It is up to the implementation to decide if the user data should be totally reloaded (e.g. from the database),or if the UserInterface object can just be merged into some internal array of users / identity map.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读