Skip to content
Advertisement

CI4 on live server not reflecting changes made, it shows old data. Dynamic contents and other changes are not reflected

I created a website using CI4 and it was working fine. On WAMP server it’s working fine. Now if change anything and update the server it shows the old data and session not working properly sometime. I think browser is caching the webpage. Is there any way to disable in CI4? Is it cache issue or session?

“Old data” means if I change a css or a section of html it wont reflect the change, and old html shows. Same for dynamic data.

Cannot login, session not holding login details. For session I am using database. Everything works fine on local server, issue only on live server. I am using plesk hosting.

Anyone have this issue?

When tried on a new pc it works fine. And if any update made and try again issue comes.

Initiated session in base controller:

JavaScript

I use this in the controller for cache control:

JavaScript

App configuration for session:

JavaScript

Tried Empty/Cache and hard reload. No caching is enable in the code.

Edit: I checked the browser as mentioned in comment and it is caching:

JavaScript

I don’t know how this is caching.

The base controller:

JavaScript

This is the login function:

JavaScript

Advertisement

Answer

i just got it working about 90% by doing as Dont Panic mentioned, added header() to controllers and added $response->noCache(); to the base controller.

Now login and other functionality working fine. Thanks all for helping

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement