Database error on first load but not on refresh Database error on first load but not on refresh codeigniter codeigniter

Database error on first load but not on refresh


This issue occurs while there is no COOKIE value set in Browser...

Are you retrieving something from the cookie and using it in your query?

Your application might be grabbing a value from a cookie and plugging it directly into the sql without checking if the value exists or is valid first. That's one possible explanation why you get errors on initial load. The cookie may be created on the first page load AFTER the database call has been made, resorting in that error. Then when you refresh the page, the cookie is already there so the error goes away.