PHP, Zend Framework and Other Crazy Stuff
Archive for May 17, 2004
Moving auth to Sessions
May 17th
Finally I’ve gotten around to getting Q_Lib (i.e. a standard game backend for QS and SR) up and going. I spent some time moving the authentication and signup processes to a Class structure which employs Sessions rather than Cookies. I also removed the PHP Redirects and replaced them all with javascript versions. I’m well aware that Sessions add only a little obscurity to security but at least now the bugs in Internet Explorer will have no header redirects to get wrong. Also moving the cookie data to Sessions will prevent any possible bugs in prior PHP versions from stripping cookie data and disrupting logins.
I’ll be updating the Quantum Star SE directory structure once again to treat Q_Lib as a drop in directory in the backend.
As for Shadows Rising all these problems stemmed from cookie usage and zero OOP. I’ll remember to use OOP where possible in SR. For example the old login process reset cookies at least four times – they were also reset in location.php with every page request. Seems a bit too much just to pass a few simple variables to identify a user to the game. Sessions need only be set once – or unset if the authentication checks fail.
On a side note I also noticed once again that superglobals were being replaced by simple variables – no doubt this was easier when superglobals were not being used – e.g. $login_id rather than $_COOKIE['login_id'] but it’s one area which now is not required and should be removed for consistency.
Quantum Star SE Beta2 will be released tomorrow with a little luck.

Recent Comments