misterx
09-24-2005, 03:13 PM
My login scripts usually consist of an initial page that tests the user/pass against the database and creates a session with a variable called AUTH or something stored in it. On pages behind the login, the session is looked for and if that AUTH variable exists then the user is considered to be authenticated and is not redirected away from the page.
My question is, is this the best way to be doing things? I'm concerned that somebody could create a session and as long as it contained a variable with the right name they would be able to act as if logged in. Or does that not work because the session would have had to be created by php in a specific way?
What if the AUTH variable contained some kind of unique id that would have to be verified? Would that make me any more secure then just having the variable in the first place? Thanks for your input. I look forward to reading your opinions.
My question is, is this the best way to be doing things? I'm concerned that somebody could create a session and as long as it contained a variable with the right name they would be able to act as if logged in. Or does that not work because the session would have had to be created by php in a specific way?
What if the AUTH variable contained some kind of unique id that would have to be verified? Would that make me any more secure then just having the variable in the first place? Thanks for your input. I look forward to reading your opinions.