I'm using ths sessions to protect my restricted area ..
My technique is:
1- make login page ..
2- check the username and the password inputed by the user against the username and the hashed password in the database .. if they are not the same go back to the login page if they are the same SET sessions with the userid and username ..
and if I wanted to protect a page I will do this in the page
- Code: Select all
if (isset($_SESSION['userid'])) {
/// show the content of the page
}
else {
/// go to login page
}
Is that technique safe enough?
I was told that it is not safe in if you are using shared host!!
Can anyone suggest me the best secure technique I can use?


