Client side page permissions - Javascript / jquery / cookies / other?
- by Ozaki
TLDR Using plain HTML / Javascript. Want to block access to some pages (doesn't have to be super secure just to stop some peeking eyes).
I thought of simply doing this by setting a cookie for each page they are allowed to visit with a value of true but thats a bit messy. Although it would work. Is there a way to set an array of values to a cookie so I can read the cookie and if a name of a page is in there then allow access with an IF statement or so on each of my pages. If they dont have the cookie just to replace my #content (entirepage) to "sorry no" etc.
For example:
$.cookie("Access","page1, page2, page3",{ expires: 1 });
Am already using JQuery, Jquery cookie. etc.
I am up for anyway of doing this cookie idea is just an example
So what do you think would be the best / most efficient way of managing this?