On my webpage I'm using a cookie that's set to 1
if they're admin
0
if they're not
so admins can have access to certain features,
how hard would it be for somebody to make a 0 into a 1 in their local cookie if they wanted to?
On my webpage I'm using a cookie that's set to 1
if they're admin
0
if they're not
so admins can have access to certain features,
how hard would it be for somebody to make a 0 into a 1 in their local cookie if they wanted to?
Cookies live on the client-side, so of course they are editable. Like everything else that comes from the client, cookies cannot be assumed secure, ever. It would be very easy for someone to make themself an admin using your design.
Don't be lazy; store the privileges on the server side and only on the server side.
It's actually pretty easy to edit a cookie. Extensions such as chrome edit this cookie allow for it to be done without even leaving the browser. I use this for simple things like web tracking on news paper sites that limit the amount of articles you can view. I reset the cookie count and voila, I am able to view more articles.
google edit this cookie if you want to demo it and apply it to your site.
Editing a cookie is easy.
But is this what you really meant?
Session variables are stored on the server and thus cannot be modified by the client. The client only stores an ID that refers to the session.