Lets just consider the trust that the server have with the user.
Session fixation: To avoid the fixation I use session_regenerate_id() ONLY in authentication (login.php)
Session sidejacking: SSL encryption for the entire site.
Am I safe ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Read OWASP A3-Broken Authentication and Session Management. Also read about OWASP A5-CSRF, which is sometimes called “session riding”.
You should use this code in a php header file:
This code prevents session fixation. It also helps protect against xss from access
document.cookiewhich is one way that Session Hijacking can occur. Enforcing HTTPS only cookies is a good way of addressing OWASP A9-Insufficient Transport Layer Protection. This way of using HTTPS is sometimes called “secure cookies”, which is a terrible name for it. Also STS is a very cool security feature, but not all browsers support it (yet).