Zend - The PHP Company




Code Gallery: mattr


A Program to Create (Relatively) Secure Sessions  

Type: code fragment
Added by: mattr
Entered: 31/07/2000
Last modified: 02/12/2004
Rating: **** (21 votes)
Views: 27938
Creates cookies to keep track of a logged in user. A lot of md5 + server-side secret keeps normal "crackers" from forging tickets. Good for times when you don't have SSL. UPDATE: For added security, place secret.php outside of your web tree so that if PHP breaks they can't easily reach the hash value. Also, forgot to add the PASSWORD into the hash! Silly me! TODO: Make the cookies update as the user continually checks in so that the cookies expire after X seconds of INACTIVITY vs. a flat 36000 seconds.


Random image from a directory  

Type: code fragment
Added by: mattr
Entered: 19/07/2000
Last modified: 02/12/2004
Rating: - (fewer than 3 votes)
Views: 6590
Generates a random image link from an image directory.




Search