AnimeSuki.com Forum

AnimeSuki Forum (http://forums.animesuki.com/index.php)
-   Forum & Site Feedback (http://forums.animesuki.com/forumdisplay.php?f=2)
-   -   Bug - Beta site (http://forums.animesuki.com/showthread.php?t=103353)

LostLogic 2011-04-13 01:15

Bug - Beta site
 
Got this on beta.animesuki.com as soon as I signed in with my Forum username:

Code:

ErrorException: Undefined property AnimeSukiSession::$favorites in /home/animesuki/beta.animesuki.com/lib/class.session.php on line 68
Trace
#0 /home/animesuki/beta.animesuki.com/lib/class.animesuki.php(316): Session->__get('favorites')
#1 /home/animesuki/beta.animesuki.com/lib/class.animesuki.php(56): AnimeSukiSession->__get('favorites')
#2 /home/animesuki/beta.animesuki.com/www/index.php(30): AnimeSukiController->Menu(1)
#3 /home/animesuki/beta.animesuki.com/lib/class.framework.php(409): IndexController->ActionDefault()
#4 /home/animesuki/beta.animesuki.com/www/index.php(245): Controller->Run()
#5 {main}

Since I didn't see a forum for feedback on the beta site, I'm posting this here.

GHDpro 2011-04-13 04:54

Thank you very much for the bug report, as this error would have only showed up upon first login (on the beta site) for users, which would then obviously be stumped at this error.

A work-around would have been to simply delete the cookies for AnimeSuki.com and try to login again - on the 2nd attempt a login would have worked.

But of course I've now fixed the problem, so it shouldn't happen again.


Technical explanation: upon first login the session class did not initialize certain custom fields from the user table (the "favorites" field among them). Combine that with the nasty behavior of isset() to also return false when a value is set but null (which was what my database object was returning for the uninitialized fields) and you get this error. Due to the session fields being cached in memcache, the error perpetuated between pages.

The solution was to reload all values from the user table after saving any new values (ie: last login time) after login, thereby properly initializing all values.


All times are GMT -5. The time now is 00:31.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.