You are here: Re: deleting cookies and local browser time versus server time « PHP Programming Language « IT news, forums, messages
Re: deleting cookies and local browser time versus server time

Posted by Good Man on 01/02/08 22:34

lawpoop@gmail.com wrote in
news:43ae8e36-b358-4a34-9b2f-699797bb0bba@l6g2000prm.googlegroups.com:

> Several others are listed in this page:
>
> http://us.php.net/reserved.variables

Yep, my bad. I guess I just tend to ignore any 'browser' information in
my apps.


>> > For unsetting cookies, the PHP documentation page for cookies
>> > recommends setting the expiration date to a point in the past.
>> > However, I'm running into problems with time conflicts. Our server
>> > is in a different time zone than the browser I'm developing on. I
>> > would like to go in five-minute increments to test my code after
>> > the cookie expires, and it took me forever to figure out why my
>> > cookies weren't expiring in five minutes.
>>
>> Don't involve the user local time at all. Put the server time in a
>> variable, and test THAT number in 5 minute increments.
>>
>
> How can I test cookie expiration with that? The browser unsets cookies
> based on what *it* thinks the time is, not what the server thinks the
> time is.
>
> In other words, if the server is in Pacific time, and I'm in Eastern
> time, setting the cookie to expire on date() ( meaning, 'right now' )
> looks to be 3 or 4 hours in the past to my browser. So, if the server
> give a cookie to expire at 4PM today, which is the time in Seattle,
> that expiration date is already in the past for me, since it's already
> 7PM.

I guess I'm having a bit of difficulty trying to understand. Cookies
are local/stored on the user browser, correct? So with you in Los
Angeles and I in New York, we'll never see each others' cookies.

I interpreted your problem as essentially keeping a file 'open' or
'checked out' (insert your verb here) for 5 minutes before
allowing/disallowing changes or something. So, if you open a file at
10amPST, and I want to open it a minute later (1pm EST), I should see
that only 1 minute has passed (as opposed to 3 hours and 1 minute).

If that's the case, what I am suggesting is that when person A opens the
document, you record the SERVER time in a database or text file. Then
when person B hits the same document, PHP compares the time elapsed on
the server between when Person A and Person B accessed the document, ie:
whether or not its been less than / greater than 5 minutes.

Sorry to be of so little help!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация