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

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.