mykeamend wrote in php

Refresher course? .. or a course in refresh/clearing cache methods?

Q: Is there a command or series of commands in PHP,or even a meta tag that would clear the visitors cache of a page, or perhaps prevent it from being cached at all?

Problem in More Detail: I have a script which looks for a cookie in order to decide how it is going to build the page that contains it.

If there is no cookie, then it is just a basic page with basic details for consumers.

If the cookie indicates an administrator, then there are options to delete, or edit, and complete details are listed including a bottom line price.

If the cookie indicates that a salesperson is logged in, then the bottom line price is shown, as well as notes from the admin to the sales people.

The problem is, that when the page is visited, it displays the layout it had the last time it was visiting. But I know the cookie and posted data are set already, because when I refresh the page, it shows at is should. My best guess is that the browser is caching the page - but if any of my browsers would do it, then so would the client's and I would rather not tell them that they have to refresh pages when the data does not show right.

There is little harm done, if the user does not have the proper cookie, they cannot use the features left from when the admin logged in - since it would be the same machine, it would probably be the administrator anyway. But I want to avoid that sort of confusion and embarrasment.

I tried making the page refresh by posting data to itself in order to get this cached page out of the way, but that didn't work out too well - it causes server burps most of the time. I can't use a meta refresh, else it would just keep refreshing and refreshing over and over again.