I am looking at creating a simple user login screen using php and mysql, I would like to know which would be better to use PHP sessions or cookies.
JasonD
1:03 pm on Jan 5, 2004 (gmt 0)
It's definately easier to use sessions though the definition of "easiness"in this instance needs clarification.
Do you mean easier to code? Easier for the end user? Easier for search engines to parse? Easier for some other reason?
Red_Eye
4:19 pm on Jan 5, 2004 (gmt 0)
The bottom 3 conditions apply the top one is minor.
ergophobe
4:28 pm on Jan 5, 2004 (gmt 0)
I'm sure you know this, but FWIW, keep in mind that by default, sessions will try to use cookies to store the session ID. You can force it not to do so or allow it not to do so if cookies are disabled, but normally it will write a cookie.
coopster
4:29 pm on Jan 5, 2004 (gmt 0)
I think it will come down to the level of security required. If you need little or no security, then a simple cookie technique would work. If you want it secure, then I would definetly use sessions with cookies. There is a decent PDF titled Session Fixation [php.net] on the PHP Session handling page that can clarify things a bit for you.