开发者

have zend auth store multiple values of identity

开发者 https://www.devze.com 2023-01-26 15:32 出处:网络
so basically when we use zend auth we can call function $auth->getIdentity() to get the ide开发者_JAVA百科ntity of the currently logged in user....the thing is...it would return the value that was set

so basically when we use zend auth we can call function $auth->getIdentity() to get the ide开发者_JAVA百科ntity of the currently logged in user....the thing is...it would return the value that was set from setIdentity() function during authentication which usually is something like username or user id....my question is.....is it possible to store multiple variables for identity for instance store both username AND user id, so that I can retrieve either one of those to display to the user and/or to pass to other script

thanks in advance!

There is no spoon

-The matrix


You can even store the entire user object if you wish. It's practically writing stuff into session:

$auth->authenticate( $authAdapter );
$auth->getStorage()->write( $user );
0

精彩评论

暂无评论...
验证码 换一张
取 消