As a result of a penetration testing process, I’ve been advised to lock cookies to the machine it was set on to stop it from being transferred and used to login elsewhere.
The app is Rails based.
Does anyone know how I would go about doing this?
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.
While you can’t really lock a cookie to a single machine, you CAN ensure that a particular cookie is only used by a particular IP address, which is usually what people mean with this security tip. It’s best to maintain that mapping in the server-side session data, rather than storing that information in the cookie itself (since otherwise someone could just edit the cookie anyway).