I have in my Website an admin panel from which I can login to manage my website, and for the login authentication, I'm using a code that checks whether the username and the password exists in the dB, and if yes, I set a variable to true like this: $_SESSION['admin_logged']= true ;
I want to know whether this way is safe or not. Because Ive heard somewhere that session variables can be stolen or sniffed or something like that. but, I really have no idea what does that mean. And how can someone steal the variables while they are saved in the server side? And if possible, how can I prevent this from happening. Thank you very much in advance.