COOKIE (Javascript/PHP)

R

RootShell

I have been experiencing a lot of troubles in reading a PHP COOKIE from
javascript.

if i write the cookie and read it in javascript in the same PHP file it
works well, but if i write the cookie for instance in a Javascript(AJAX)
called PHP file, the Javascript can read it.

Any ideas why?

This is a Javascript issue and not PHP, that's why im asking it here.

Kind regards,
RootShell
 
P

Peter Michaux

I have been experiencing a lot of troubles in reading a PHP COOKIE from
javascript.

There are not PHP or JavaScript cookies. There are just cookies and
PHP and JavaScript can read and manipulate them.
if i write the cookie and read it in javascript in the same PHP file it
works well, but if i write the cookie for instance in a Javascript(AJAX)
called PHP file, the Javascript can read it.

That is a mouthful of an explanation. I'm not clear what is the
problem but I'm guessing that there is something to do with the path
part of the cookie and that you are not setting that part at all or
correctly.

Peter
 
R

RootShell

Peter said:
That is a mouthful of an explanation. I'm not clear what is the
problem but I'm guessing that there is something to do with the path
part of the cookie and that you are not setting that part at all or
correctly.

Peter

You are absolutely right...

I changed the path part of the cookie and it worked like it was supposed to.

Thanks for the 'late' feedback anyway.

Kind regards,
RootShell
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top