I'm having an issue with Livewire and session data seems to be automatically cached by Livewire:
I have a Livewire component "1" that allows you to select a store from a list,
Once a store is selected, a Livewire function is triggered via wire:click to save the selected store session and a withdrawal hour in session,
Another Livewire component "2" allows you to display the selected store and the withdrawal hour,
This Livewire component "2" at the time of mount(), checks if the withdrawal hour is not less than the current one, if yes we modify the withdrawal hour by modifying the session via session()->put().
-> It is at this step that the problem appears, the session is indeed modified when the component is displayed and the modified withdrawal hour appears.
On the other hand, if I refresh the page or change pages, the saved session is always the old one. Likewise if I display the session in a classic controller, I have the old value. I am forced to F5 the page several times for the new value to be definitively saved.
It seems that session manipulation is only done locally inside the component but not globally in case it is done without user action.
I can confirm the same behavior on Laravel 11 Livewire 3.
wire:click has a different session()->getId() per click. So it's treating the XHR as a whole separate session. I wonder if that's intended?
Disregard. I have multi-tenancy in the other app. A blank app worked correctly., so I may have to set the update route correctly in Livewire. Using the setUpdateRoute fixed this correctly