1

so basically when we use zend auth we can call function $auth->getIdentity() to get the identity 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

Charles
  • 50,943
  • 13
  • 104
  • 142
kamikaze_pilot
  • 14,304
  • 35
  • 111
  • 171

1 Answers1

3

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 );
Vika
  • 3,275
  • 18
  • 16