Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > COOKIE (Javascript/PHP)

Reply
Thread Tools

COOKIE (Javascript/PHP)

 
 
RootShell
Guest
Posts: n/a
 
      04-26-2007
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
 
Reply With Quote
 
 
 
 
Peter Michaux
Guest
Posts: n/a
 
      04-27-2007
On Apr 26, 4:14 pm, RootShell <rootsh...@ifreviews.org> wrote:
> 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

 
Reply With Quote
 
 
 
 
RootShell
Guest
Posts: n/a
 
      04-27-2007
Peter Michaux wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is different between Request.Cookie and Response.Cookie ad ASP .Net 2 01-27-2006 12:54 PM
Cookie Question (IP as domain and cookie file location) =?Utf-8?B?UGF1bA==?= ASP .Net 1 01-10-2006 08:37 PM
Any downsides to cookie assignment inside custom class using HttpContext.Current? ASP.NET 2.0 cookie fix? ASP .Net 2 08-17-2005 06:43 AM
Cookie and Session Cookie Questions. Shapper ASP .Net 1 04-27-2005 11:20 AM
Session cookie? Browser instance cookie? Ben ASP .Net 3 06-03-2004 03:41 AM



Advertisments