Jump to content

[SOLVED] URGENT: ARE COOKIES GLOBAL TO A WEBSITE? :)


newbie69

Recommended Posts

Hi guys,

 

I seem to having some issues with reading a cookie from different parts of my website.

 

I have been suspecting my code for a long time only to come to realise that my cookie cant be read across the site.

 

I have created a simple test to show that if I set a cookie on one page in folder of the website, it cannot be accessed if i call it from another folder.

 

A page that sets a cookie in the folder "Premier":

 

http://www.quickbooks.co.za/products/accounting/premier/setCookie.php

 

A page that reads the cookie, which reside in the folder "Premier":

 

http://www.quickbooks.co.za/products/accounting/premier/printCookie.php

 

this above works, so cool :) BUT

 

why cant the cookie that was set above work when read when i call it from a page in a folder outside of folder "premier":

 

In a folder out side of "premier" :

http://www.quickbooks.co.za/products/accounting/accountant/printCookie.php

 

 

Is there way for me to make cookies GLOBAL? i.e have it created anywhere on the site, and access it anywhere?

 

Thanks alot in advanced!

 

Sudhir

 

The best place for these kind of questions is the manual. If you look under the description for the path parameter, you will notice that, by default, a cookie is only available in the folder it was set in. To access it across you site, you must specifiy a path of /

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.