Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP cookie and page loading problem

Status
Not open for further replies.

ksoong

Programmer
Oct 3, 2000
57
CA
Hi there, I am trying to write a script that generates a file that will be loaded onto a web site. assuming that this web site has high traffic volume.

I want the file displayed to only be generated once every 10 minutes the user visits the site.

I am trying to make this application scalable so that it can be customized to be used for many different sites, while using the same code. The only thing separating the sites would then be their siteid.

I tried using cookies on the users' computer, but some users turn their cookies off.

I was therefore thinking of using a log file type approach on the application hosting server. So that if the users' cookies are disabled the application tests the users last login time by checking the log file.

the only problem that I am facing is that I am assuming that the websites using this application will be high traffic. so the number of cookie-disabled visitors, in sequence might be high. this means that one cookie-disabled visitor would visit the site, cause the php program to detect that they don't have cookies, and then write to a log file. it would be fine it the same user were to log back on less than 10 minutes later. because the log file would still be fresh.

but if another cookie-disabled user were to login immediately after the first cookie-disabled user, then the log file would be overwritten. and therefore, if the first cookie-disabled user were to visit the site less than 10 minutes after, but also after the log file was rewritten, then the log file would be useless, because it would not have that user as currently listed.

Does anybody have any other suggestions that I could program into PHP that would allow for this application to maintain detection of a users' log time without facing the above problems?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top