I'm not entirely sure the title is correct as I could not yet figure out how I got to this problem.
What I have:
simple model with 2 fields
crud controller
on create / edit I process the data and redirect with some info. info is passed by one of 2 methods:
session()->flash("key","info")
redirect()->route("route.name.here")->with("key","info")
I added (to the bottom of my layouts blade file) a line to see what is stored in session hoping I'd get a clue on what's going wrong
@dd(session()->all(),session("_flash"),session("key"))
What is my actual problem? I get the same info again and again.
- create new instance and flash confirmation to user
- valdiation returns with error message
It does not matter which one happens I get the returned info again on each successive page call. If I do something to get a new message that message replaces the old one and stays with me on every page of my site. (even the home-page that does nothing but give you some "lorem ipsum" text) If the last info was an error due to failed validation I also keep the old inputs. The index-page only loads the instances and loads the view file (with the data). For example switching through the pages of the index file (I am using laravels pagination as found in the docs) and due to the dump output I can see that nothing in "session" changes (that includes the entry with key "_token". I thought this one should change but I currently can't check with a working site). The form to create a new instance (of the model) is included in the index-page (Bootstrap card header with inline form as it only requries 1 field).
What did I already try?
- clear the cache
- delete session files (the get created again)
- restarting apache
- rebooting the server (similar to raspberry pi)
I could not figure out how I fk'd this up and am hoping for some pointers
System:
- PHP: 7.3.0alpha4
- Laravel: 5.6.29
- Session handling: file
- OS: Ubuntu 18.04.1 LTS
Edit:
I was able to check the _token
key with a different laravel installation and the value changes with every page load. Looks to me there is a problem with session handling but I can't figure out where as it only has partial problems (writing something new to it obviously works but changing seems to run into a problem)
Edit2: