
March 23rd, 2007
02:51 AM
funny and cheeky
Status: Offline!
php not detecting cookie it set
The idea was the script would attempt to set a cookie then check if it has been set. As far as I know, php sessions uses cookies to store the session id. Hence the browser must have cookies switched on. However when it comes to test if the cookie was created it says it hasn't been set. When you look in cookies browser its there. When u refresh the page it says it has been created ???
I just used the set cookies command
setcookie("test","testing");
tested if it was created using $_COOKIE and the isset

March 23rd, 2007
05:16 AM
Nobody fucks with my title.
Status: Offline!
Cookie creation is sent back in the HTTP response from the server, and as a result the cookie(s) is/are not available in $_COOKIE until the next request from the client, since that's when $_COOKIE is populated.
___________________
<3

March 23rd, 2007
05:34 AM
God's Son
Status: Offline!
since cookies have to be set before any of your content is rendered to be viewed you can always set the cookies and than redirect the user to the same page, some what of a refresh using header location header("Location: index.php"); for example, this will alow you to use $_COOKIE since it will be able to be used after the refresh of the page
___________________
"The secret to creativity is knowing how to hide your sources." -- Albert Einstein

March 27th, 2007
11:43 PM
funny and cheeky
Status: Offline!
ah I thought it might be something like that. It actually makes a lot of sence because the server has no control over the client hence it would have to be sent in the http headers.