Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
03-09-2014, 09:36 PM #1
- Join Date
- Aug 2010
- Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
- Thanked 1 Time in 1 Post
help with setting and reading cookies?
These pages and scripts are located in directory under the content that it
is supposed to manage.
The cms interface page is secured by scripts and sets a cookie to read to
screen each logged in request ( it is not using https.)
What I want to do is have the cookie set and be able to read it from a
page in the directory above where it is set. This is so I can block access
to the public content while admin and revision is going on, but not block
access to the client with the right cookie.
I have been using document.cookie('var=value;path=/;domain=localhost') -- ( localhost is dev server).
But when I open preference panel in Firefox to read the cookies, it shows none.
Whereas if I just write document.cookie(var=value) it works. But I cannot read the cookie in a page in
the directory above it.
Do I have to set the time values also? Or what?
editing: I finally got the right syntax and variable values. It should have been domain=local network address
for local dev server. The dev server is not on the same machine as the client, in which case it would be 'localhost'
the cookie value ( - www. or whatever )
Last edited by anotherJEK; 03-09-2014 at 11:23 PM. Reason: solution found