Jump to content

help understanding which header function to use


RyanSF07

Recommended Posts

Hi All,

 

I have a question regarding headers.  Currently I'm using a php function that creates the html header:  "Cache-control: private" on pages inserting or retrieving content from the database. I don't think this is the correct header to be using and I'm confused about which is the best fit.  The site I'm working on relies solely on session variables. No cookies are ever set.  There are quizzes -- the users' selected answers are compared to actual answers in the DB when the user clicks to see the results. 

 

I've noticed that when a quiz sits in a browser for 15 to 30 minutes before the user clicks to see the results, that sometimes totally random results appear -- as if the site had timed out, then sent a random "hey show me some results" request to the server, but the server didn't know which quiz we were on.

 

I'm googling myself in circles over these:

cache control: No-store

cache control: max-age

cache control: must-revlidate

cache control: proxy-revalidate

cache control: max-age

 

or should I instead use the "session_cache_limiter()" function? 

 

If you have advice on which is the best fit and how/why -- Please let me know.

 

Thank you very much for your help.

Ryan

My code checks to see if the session userid is set, and if not throws an error.

 

So.. which header best does this:

 

- check to see if session has timed out

- if not, perform the query

- if so, the query is not performed and the "$sorry_error" is thrown

 

thanks again for your advice..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.