newbie69 Posted June 26, 2008 Share Posted June 26, 2008 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 Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 26, 2008 Share Posted June 26, 2008 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 / Quote Link to comment Share on other sites More sharing options...
dannyb785 Posted June 26, 2008 Share Posted June 26, 2008 Is this really that urgent? Quote Link to comment Share on other sites More sharing options...
newbie69 Posted June 26, 2008 Author Share Posted June 26, 2008 Hi GingerRobot Thanks for that, I will give it a shot, Thanks alot! Sudhir p.s it was pretty urgent for me dannyb785. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.