Page 1 of 1

Login Options

Posted: Fri Mar 26, 2004 12:16 am
by reverend_ink
I have a script and want to keep people from being able to view it unless they login. And then when logged in they get to look at all the pages until they leave, then if returning they have to loggin once again.

I am considering sessions but havent used them often.

Any recommendations?

Thanks

Posted: Fri Mar 26, 2004 12:22 am
by PrObLeM
session is exactly what you need

http://www.php.net/manual/en/ref.session.php

Posted: Fri Mar 26, 2004 12:35 am
by reverend_ink
That what I thought, but I havent dealt with them often, I generally deal with CMS systems and they are protected via htaccess

Posted: Fri Mar 26, 2004 4:30 pm
by tim
man everyone loves sessions, I dont really fancy em, they're nice, but ah well..

i'm an old school cookie man =]

setcookie () with combo of isset() will create a handy dandy way of keeping users logged-in and they're info (username n password, etc) for a easy fetch.

even better - a combo of them both

Posted: Fri Mar 26, 2004 5:50 pm
by Chambrln
Sessions can do pretty much exactly the same stuff cookies can, except sessions terminate once the browser is closed or you specifically terminate it in your code.

Cookies are good if you want to keep someone logged in to your site once they leave but if you are trying to just do a one time visit authentication then I would say use sessions.

Posted: Fri Mar 26, 2004 6:52 pm
by Pyrite
check out phpsecurepages.com