The cache of laravel works for me but is the same values in different browsers.
I'm trying to set a session in laravel, and set session variable through ajax call, then in another ajax call get that session variable.
$.ajax({
type: "post",
url: url+'setdata',
data: $('form#data').serialize(),
dataType: "json",
processData: false,
async: false,
success: function (data) {
}
});
$.ajax({
type: "post",
url: url+'getdata,
data: $('form#data').serialize(),
dataType: "json",
processData: false,
async: false,
success: function (data) {
}
});
In the first ajax request, I call a function from one controller in laravel. This function performs:
Session::put('examplekey', 800);
In the second request, the controller function retrieves the session ID:
$var = Session::get('examplekey');
return array($var);
My problem is, in the second ajax call the session disappears. How can I can set the same session for the same user, in pure php with session_start();