But it doesn't work, even if you use different zip codes. Once in a while it will remember one, but most of the time, no matter what different zips you give it, it only remembers that newest one. Its driving me crazy.

    I don't own an iPhone or run safari. But aside from the design flaw, it did work as it is supposed to in my browser (FireFox 3).

      Thats odd because i tried it in firefox 3 and safari and it wouldn't work. Somehow it was only storing a serialized array with teh most recent search.

        Here is Proof : )
        and I didn't photoshop it I pinky swear.

          Alright I checked again and your cookies seem to be expiring, well that is being too kind, they are already expired when they are set. Please review the time in the server that hosts your script.

            I'm so confused. You are right that my cookies are all using todays date. But look at my code, they should be a year from now. I checked the date on my server and it's exactly right. Why would the cookies come in like that? How does now + a year = now?

              Waaaaaaaaaaaaaait a minute. Do I have put the serialized array in a string? That could maybe me my problem right?

                did you do:

                <?php
                echo time();
                ?>
                

                If the time is good on your server, I'm afraid I have ran out of ideas.

                  You could try to put the serialized data into a variable before passing it to setcookie(). But I doubt that is the issue, because it would probably mess up the rest of the parameters in setcookie(), and as far as I can tell, they all get set.

                    The cookie is being set to the correct date.
                    Try doing print_r( $_COOKIE ); before the query.

                      Well your server's time outputs today's date at 11:20 pm, so it is a little off. But this shouldn't make a difference, since you are setting your cookies to expire in about a year. Is there a particular reason why you are setting two PHPSESSID?

                        The unserialize is not working because of the escaped quotes.

                          24 days later
                          HalfaBee;10895965 wrote:

                          The unserialize is not working because of the escaped quotes.

                          Yup you called it. Added a stripslashes() in there and all is well.

                            Write a Reply...