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

noge075's avatar

Session flash data stucked

Hi guys!

A have an issue with redirect() function with method, after updating to Laravel 5.4.

return redirect()->back()->with(["success" => "The blog post has been saved!"]);

I'm using a simple alert blade template:

@if (session()->has('success'))
    <div class="alert alert-success">
        <p>{{ session()->get('success') }}</p>
    </div>
@endif 

My problem is after I successfully save a post the message is always showing. I tried to use the forget method for this key after reading but everytime when I refresh the page on that session the message is still showing.

Here is my debug bar: http://imgur.com/a/YG8sm

That's looks the same after refresh.

Thank you!

0 likes
3 replies
Nash's avatar

Is the application key set in your .env file?

noge075's avatar

Yes. A have some cache issues because I'm using multi subdomain with cache.

Please or to participate in this conversation.