Pages

Subscribe

Tuesday, February 20, 2007

PHP - Login / Logout With Sessions

Imagine you're starting a PHP website and you want to have a member's area where your members can login and maybe upload pics / post text / whatever. Rather than ask their username + password on every single page they visit it would be best if you had them logged in for a "session", and this session would stay logged in across any pages they visit until they logout or a given maximum time limit (you need to have them log out some time for security reasons)
Anyway, PHP, being the amazing language that it is gives us tools to work with sessions and once you get used to it, this can be a great addition to your site.

Here are a few great tutorials / scripts for setting up a login + logout / members area based on sessions on your site:

http://phpsense.com/category/PHP-Sessions/
http://www.tizag.com/phpT/phpsessions.php
http://www.phpsimple.net/tutorials/login_logout/
http://simpleauth.munk.me.uk/
as usual, props go to 2kreative for most of these links.

No comments: