Reload laravel session data by jquery Hi guys,
I am looking for some help. I would like to reload the Laravel session data after a success ajax request. I am trying to show the new session data using a bootstrap modal.
Any ideas??
Thanks a lot.
return the session data within the success function of AJAX?
Controller:
return response([
'sessionData' => session()->all()
]);
View:
<script type="text/javascript">
$.ajax({
url: '/path/to/file',
type: 'default GET (Other values: POST)',
data: {},
success: function (result) {
// use it here
sessionData = result.sessionData
}
});
</script>
Thanks for the answer. I was looking for a function to reload session data (grrrrr). Pass a variable with the data will be fine. ;)
@Ozan You really want that second award don't you ;)
@blackbird Yeah :D I mean why not? I gave a useful answer. Ain't I?
Please sign in or create an account to participate in this conversation.