I am trying to save an object to a cookie, but its giving me the following error
Fatal error: Call to a member function view() on a non-object in D:\__APACHE\test.php on line 70
http://pastebin.com/338595
Any ideas?
I am trying to save an object to a cookie, but its giving me the following error
Fatal error: Call to a member function view() on a non-object in D:\__APACHE\test.php on line 70
http://pastebin.com/338595
Any ideas?
solution found:
http://pastebin.com/338605
i had to strip slashes from the cookie content.
question?
if(setcookie("saved_cart", serialize($shopping), time() + 3600, "/" ))
why do they always set a cookie for the root of the site "/" thats pretty annoying!! . In this case I thing its valid but everysite I use always set cookies for their root. causing the cookie to sent in every http request even when not needed. Is it just a lazy thing or is it a design feature? why not set cookies for uri that need the cookie?
SideNote: I am no php or wed developer but I write network code that medel with HTTP and the cookie thing is a royal pain in the ***.
Its probably because thats how they learnt to do it in a tutorial somewhere. I put it in, especially during development because as I move scripts around the path changes and its just easier to leave at "/" and from I have seen most people who use cookies want it accessible from root anyway based on what they are doing with it.Originally Posted by leoandru