xx666xx
(Jerryablan)
June 9, 2009, 4:51am
1
Question:
I have code in my authenticate() method of UserIdentity. However, this does not get executed when a user returns via auto-login.
Is there an event I can hook onto to put my post-login code?
I'm confused as to where this could be done.
Any help would be appreciated.
– Jerry
qiang
(Qiang Xue)
June 9, 2009, 2:53pm
2
authenticate() is only used when you call login(). When a user is authenticated by a cookie, this method is not invoked because the user identity is restored from the cookie information. Only CWebUser::restoreFromCookie() is invoked in this case.
xx666xx
(Jerryablan)
June 9, 2009, 8:46pm
3
Yes, I found that.
I guess what I'm getting at is this:
Is there a single event or method that I can use to load information from the database about a user once he has been logged in?
Or do I do it once and store it in the user state and then each web page reads from the cache?
xx666xx
(Jerryablan)
June 9, 2009, 11:47pm
4
I think the best place to do this is in CWebUser::changeIdentity. I'm going to try that.