Welcome Guest, Not a member yet? Register   Sign In
Strange Caching/session issue
#1

[eluser]Skoobi[/eluser]
Hi im getting some strange issues but i cant tell why or what is happening...

I have a table with actions i.e. delete_post, unpublish and so on. But if i click on delete or unpublish it goes to the url and does the action but doesnt refresh the page. If i then press refresh it shows the action that has been carried out.
I.e. If i delete a post i click the delete link and it will go into the controller and carry out the function and return to the page but the item is still there. If i look at the db it shows its been deleted. Then if i refresh the page the flash message pops up and the item is gone.
I get this on my contact page as well which when i send it it should come back to the contact page with flash message but it doesn't show the flash message in till i refresh the page.

Has anyone had this issue before or know what i need to look for.

Many thanks
Chris
#2

[eluser]CroNiX[/eluser]
Very hard to say without seeing the code as there are many things that could cause this.

One thing, you mentioned flash messages. Those aren't available until the NEXT request to the server (not same request), so that might explain why it doesn't show up until you refresh the page, which issues a new request.

If that's what you're doing, you could just store the "success" message, or whatever, as a variable and pass it directly to the view instead of using session::flashdata().
#3

[eluser]Skoobi[/eluser]
The code hasnt changed and it was working ok. But heres basicly whats happening.


Contact Page > then on submit goes to the sendMessage function in my page controller > then comes back by a redirect to the contact page with a flash message for success or not.


What its doing is on submit it will do the actions, so it sends the message and returns back to the page but doesnt show the message unless i click refresh browser.

Its the same as in the admin area ive done. I have a tasks section and if i click on complete button it will preform the action and update the database but doesnt show up when it returns to the page. Just to further explain that one.
Task function in controller i have a button for close task. If i click that button it goes to the close_task function makes the changes in the database and then redirects with flash message to the tasks page. In the tasks page i have a status column which tells you the status. But that doesnt change (even though is updated the database) unless i click on the browser refresh.

Its really strange.
Im on the verge of starting a new project and see if it does it with that and if it does i can definitely point the problem to the serve (my own vps and nothings changed in 2 years)

Cheers
#4

[eluser]Skoobi[/eluser]
Ok so i found the problem...

I backtracked and took things out of the equation and found that it was the .htaccess file.
Put that back to as i had originally and all worked.
I think what happened was i uploaded a invoicing script which on installation uploaded its own htaccess file.





Theme © iAndrew 2016 - Forum software by © MyBB