18
Currently when user logged in, i created 2 sessions.
$_SESSION['logged_in'] = 1;
$_SESSION['username'] = $username; // user's name
So that, those page which requires logged in, i just do this:
if(isset($_SESSION['logged_id'])){
// Do whatever I want
}
Is there any security loopholes? I mean, is it easy to hack my session? How does people hack session? and how do I prevent it??
EDIT:
Just found this:
http://www.xrvel.com/post/353/programming/make-a-secure-session-login-script
http://net.tutsplus.com/tutorials/php/secure-your-forms-with-form-keys/
Just found the links, are those methods good enough?? Please give your opinions. I still have not get the best answer yet.