I’m building a cookie based shopping cart, I’m not sure if I should be using JavaScript or PHP for setting the cookies. Which would you use JS or whatever server side language you are using on the same project and why?
Share
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.
I would use what was appropriate for the specific situation.
Making a round trip to the server to set a cookie seems silly, and sending JS to the client to set a cookie the server generated also seems out of the way.