Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

casanova's avatar

JS access session flashed information

edit | TL:DR; how can I get access to the session method or something similar in JS as I do in PHP? Since flashed messages are only for that http request I can't make an axios call to get those values.

Hello. I'm flashing a status message to the session and returning a json object to my vue app with the location to redirect with window.location.href. After redirected to target page I have normal access to the Session::get('status') method as I should.

Now I want to develop a status toast vue component to flash it for me, how do I access the session or the session flashed messages through vue/js so I can store them in store.state?

I don't know if this is relevant, but I'm using vuex, separating my front from the backend. All store initial state data come from axios api calls called on created() method

Thanks in advance

0 likes
1 reply

Please or to participate in this conversation.