I have a PHP script which sets a cookie called user. I need to be able to read the value from this cookie in javascript.
Can this even be done.
Thanks for any help you can provide.
There's no such thing as a "PHP cookie" or a "javascript cookie". There's just cookies, which you can access from PHP and Javascript. In JS, you'd use document.cookie
to access the raw cookie data. There's plenty of libraries which give you finer-grained access as well,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With