I would like to save a new session variable immediately to the database and clear the cache entry related to it. If I just set the variable using $_SESSION, there seems to be a small delay before the value is available for the next page request. In my case, the next page request comes almost immediately after the variable has been set up.
So the questions are:
- I found a way to inject the new value straight into the session table in the database. How but how to delete the related cache entry?
- Or is there a way to turn to session data cache off? Does it affect a lot to the performance?
A workaround could be to find another way to pass data between page loads. Cookies are not a solution because a user could manipulate them.