When creating a site that requires a user to login to gain access, so far it seems to me that there's 2 common ways to set it up:
- Use Apache's Basic authentication (using htpasswd, and .htaccess and .htpasswd files -- and even Apache::Htpasswd).
- Use something like CGI::Session along with cookies (CGI::Cookie).
If your site doesn't require anything persistent beyond just remembering that the user is logged in, what are the reasons for choosing one of the above methods over the other?
I understand that, as soon as you start needing some persistent state (like, keeping track of a user's shopping cart), then you need to go with something like option 2... But, are there circumstances where you'd use both of the above options together?