Reputation: 4815
In Laravel 5.5
, I am having crud
operation for slider, the store method is as follows
public function store(StoreSlider $request)
{
$image = $request->image;
$name = $request->name;
$status = $request->status;
$path = Storage::putFile('slider', $image);
Slider::create([ 'name' => $name, 'image' => $path, 'status' => $status ]);
Session::flash('message', 'Slider added successfullly');
return redirect()->route('slider.index');
}
It redirects to index
page, and shows the message Slider added successfullly and i am using the below code to display the session:
@if(Session::has('message'))
<p class="alert_msg"><i class="icon-correct-signal"></i> {{ Session::get('message') }}</p>
@endif
and i am hiding the above message with the following code,
setTimeout(function() {
$('.alert_msg').fadeOut('fast');
}, 3000);
All the above are working fine.
In index
page the message once shows and hides.
In index
page having view option
, that show the added slider, if i come back by click any URL
, the session message not showing. Perfect
The problem is while in view
page i come back by click on browser back button the session message shows again
Can't able to find whats the issue.
Upvotes: 1
Views: 1302
Reputation: 559
use the following headers
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
Upvotes: 3