Quick sidenote: this is not a "possible duplicate" of the post Is It Possible to Sandbox JavaScript Running In the Browser? , it had nothing about cookies - and I need to ask about cookies. I did read the answers, though.
Hello! I have a webpage where (registered users) can create their own HTML pages and access and edit them easily.
Each time a user does an action, to prove that the user who does the action IS the user on which account the action is done (in other words, to verify a user), a login token is sent to the server along the action that has to be done. (Quick note: the token I am storing is NOT the user's password, it is a randomly generated string which changes on each login). And this works, but there is a problem.
As the users have an ability to create their own HTML pages, someone could create a page which reads the user's login cookie and sends it to someone. Using this method, someone could get inside someone else's account.
I heard about https://developers.google.com/caja/ - something which seemed very useful. I read the CAJA page, but there was nothing about preventing cookies.
Ideally, I would like users to still be able to store and read their own cookies, but not the login token one. Though that is probably impossible.
So, completely blocking user-created scripts from reading or writing cookies would work.
But there's a problem: I am completely new to CAJA. Could someone explain how to block cookies using CAJA or in fact - anything like it?
Thank you in advance