I have a webpage, let's say that the page is called: http://www.mypage.this/
In my page users can create their own HTML pages and access them through www . mypage . this / (creator's_username) / (project_name) . For instance, if my username is "USR" and my project is called "PROJECT" then the link is http://www.mypage.this/USR/PROJECT .
But there's a security problem...
I store people's login tokens as cookies. And what if some user's script has a function which reads the cookie and sends it to someone else?
They can get access to someone else's account. The token has to be saved as a cookie, because I need to verify the user in multiple pages. What should I do to prevent the user created scripts reading the tokens, yet still allow my pages to read the token?
Thank you in advance
*The tokens are of course regenerated every once in a while
To clear misunderstanding, I am NOT storing passwords in the user's side. I am storing a login cookie - a randomly generated string, re-generated on every login. And I store that on the user's side.