Missing Cookies

G

ganchrow

OK, so this kind of weird. Using FF CookieSafe, extension, I can view
several cookies. BUt when I use the following JavaScript:

<script>
function getAllCookies() {
var ca = unescape(document.cookie).split(";");
var retVal = '';
for( var i=0; i < ca.length; i++) {
retVal = retVal + ca + "<BR>";
}
return retVal;
}
</script>

<input type=button
onclick='document.getElementById("divFoo").innerHTML =
getAllCookies();' value='Show Cookies'>
<hr><div id=divFoo></div><hr>

.... several cookies just aren't there. I know it's not a domain or a
path issue as the missing cookies have the same domain and path as the
visible cookies.

Any idea what might be possible be wrong and/or at what I should be
looking?
 
G

ganchrow

OK, so this kind of weird. Using FF CookieSafe, extension, I can view
several cookies. BUt when I use the following JavaScript:

<script>
function getAllCookies() {
var ca = unescape(document.cookie).split(";");
var retVal = '';
for( var i=0; i < ca.length; i++) {
retVal = retVal + ca + "<BR>";
}
return retVal;
}
</script>

<input type=button
onclick='document.getElementById("divFoo").innerHTML =
getAllCookies();' value='Show Cookies'>
<hr><div id=divFoo></div><hr>

... several cookies just aren't there. I know it's not a domain or a
path issue as the missing cookies have the same domain and path as the
visible cookies.

Any idea what might be possible be wrong and/or at what I should be
looking?


If it means anything, I can read the cookies from PHP, but can't read
(or delete) them from JavaScript.

Does anyone have any ideas at all?
 
G

ganchrow

OK, so this kind of weird. Using FF CookieSafe, extension, I can view
several cookies. BUt when I use the following JavaScript:
<script>
function getAllCookies() {
var ca = unescape(document.cookie).split(";");
var retVal = '';
for( var i=0; i < ca.length; i++) {
retVal = retVal + ca + "<BR>";
}
return retVal;
}
</script>

<input type=button
onclick='document.getElementById("divFoo").innerHTML =
getAllCookies();' value='Show Cookies'>
<hr><div id=divFoo></div><hr>
... several cookies just aren't there. I know it's not a domain or a
path issue as the missing cookies have the same domain and path as the
visible cookies.
Any idea what might be possible be wrong and/or at what I should be
looking?

If it means anything, I can read the cookies from PHP, but can't read
(or delete) them from JavaScript.

Does anyone have any ideas at all?


Here was the problem: the cookie was set by PHP with HTTPONLY set to
true.

Setting it with HTTPONLY set to false eliminates the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top