So I have been a full time Ubuntu user for the last year. Even though I am a junior linux sysadmin, I had never been using Linux in a Desktop/Workstation environment until I started working more as a php web developer. I was getting pissed out of Ubuntu for some silly reasons and was getting pissed...
There is going to be a nice schedule with great speakers : Hugo Hamon & Fabien Potencier from Sensio Labs (Symfony) Andrei Zmievski (PHP-GTK) Ilia Alshanetsky (Core PHP Team) Graham Weldon from Cake Development Corporation And a lot more : http://confoo.ca/en/2011/speaker It's their second year, and...
Just out of curiosity. Here's mine: Indention: no tab (0x09) per se. My tabulation is 2 two spaces. Curly brackets are always alone on one line, ex: if($v === true) { print "Yes!"; } I try to never use // as comment. Always something like that: / My soooo useless comment / I never use short-tags (<?...
Why do you use DES as the encryption mechanism? It's a poor cipher. If you want something compatible, you should try using stronger symmetric ciphers (AES, Blowfish, 3DES. etc). And if none are available, use DES and leave a warning. Hell, I'd throw an error, just like if you are using magic_quotes.
You should be using another cipher block mode. ECB is prone to replay attacks. Use CBC instead (MCRYPT_MODE_CBC) with an IV initialization. Make sure you do it, otherwise PHP just uses \0 (byte 0) and this mechanism will be useless.
Set the session cookie parameter HTTP-Only with session_set_cookie_params(). So if your application is vulnerable to a XSS attack, at least the session cookie can't be read with javascript. Edit: Consider also the secure parameter if you are using HTTPS. When a cookie has the Secure flag, the browser does not send the cookie if the connection isn't HTTPS.
In your code, you are using the _salt attribute as the key parameter for mcrypt_encrypt. You should rename for easier code review and readability.
I haven't read all the code, but if you are using an authentication method, make sure that the session ID gets regenerated on a successful login.
Further edits:
I do not really understand the mechanism for your session. Why do you encrypt the data of your session on the server? It is pointless because if someone compromises the application and reads the sessions, the attacker could use the key that is used in your application (t3st!ng) to decrypt the session data.
YouUse a framework, a real one.Great, but why?
Disclaimer: I'm a security consultant.
I took a lookg at your Session class.
Why do you use DES as the encryption mechanism? It's a poor cipher. If you want something compatible, you should try using stronger symmetric ciphers (AES, Blowfish, 3DES. etc). And if none are available, use DES and leave a warning. Hell, I'd throw an error, just like if you are using magic_quotes.
You should be using another cipher block mode. ECB is prone to replay attacks. Use CBC instead (MCRYPT_MODE_CBC) with an IV initialization. Make sure you do it, otherwise PHP just uses \0 (byte 0) and this mechanism will be useless.
Set the session cookie parameter HTTP-Only with session_set_cookie_params(). So if your application is vulnerable to a XSS attack, at least the session cookie can't be read with javascript. Edit: Consider also the secure parameter if you are using HTTPS. When a cookie has the Secure flag, the browser does not send the cookie if the connection isn't HTTPS.
In your code, you are using the _salt attribute as the key parameter for mcrypt_encrypt. You should rename for easier code review and readability.
I haven't read all the code, but if you are using an authentication method, make sure that the session ID gets regenerated on a successful login.
Further edits:
I have had experiences at my previous job with SVN being slow. A simple svn update would take 10 minutes before even starting to actually update.
Solution: switched to git