Hello, I'm new to PHP, but not to programming by any means. I just wanted to run this by more experienced PHP programmers to see if I'm on the right track.
To authenticate a username/password to login to a website I'm thinking the basic process would go something like this pseudo-code:
start-session
if(check-session = true) {
display secure webpage
}
else
if(check_cookie = true) {
authenticate with database(user/pass) = yes
save-session-information
display secure webpage
}
else {
goto page login.php
}
}
Is this a good process in general? Is it secure?
The reason I'm using a session along with a cookie is because I'm trying to avoid authenticating with the database every single time a secure page is requested. Does this logic make sense?
Thanks!
To authenticate a username/password to login to a website I'm thinking the basic process would go something like this pseudo-code:
start-session
if(check-session = true) {
display secure webpage
}
else
if(check_cookie = true) {
authenticate with database(user/pass) = yes
save-session-information
display secure webpage
}
else {
goto page login.php
}
}
Is this a good process in general? Is it secure?
The reason I'm using a session along with a cookie is because I'm trying to avoid authenticating with the database every single time a secure page is requested. Does this logic make sense?
Thanks!