Questions tagged [laravel-session]
101 questions
2
votes
5 answers
Laravel - Stop concurrent access to record
In Laravel is there any way to stop interacting with the same record simultaneously. For example, if User A is editing a record then at the same time I need to stop User B from editing same record.
Note: I am using SESSION_DRIVER=file & Laravel…

Bilal Maqsood
- 1,163
- 3
- 15
- 43
1
vote
1 answer
Laravel 8: Session put works but session flash does not work
I'm using Laravel 8 for my project and for updating a form and there fore in the Controller, I added this for showing success message:
Session::flash('success','asdasd');
But this does not show any data in the blade:
@if(\Session::has('success'))
…

Pouya
- 114
- 1
- 8
- 36
1
vote
1 answer
Refresh session values in view Laravel
I want to refresh the session data in the view without a reloading view.
I have a POST method with ajax:
$.ajax({
type: "POST",
url: '/recargarTipoCentro',
data: {
entidad_id: $('#entidad').val(),
…

obernal
- 21
- 3
1
vote
0 answers
Laravel Flash Session Does not appear
I am working on a project in which I am using flash session after form submit to display the message. But the problem is that the flash session message sometimes appears and sometime not.I know this issue mostly occurs when web middleware is applied…

Khizer Rashid
- 11
- 2
1
vote
1 answer
Laravel sessions are destroyed after login from Google
I am using Laravel Shopping cart and Laravel Socialite for login, login works fine but when the user logs in it deletes his Cart and all other sesshions on the page, do you know how to fix it ? Thanks
The reason I need this is that the user has the…

Pepa Zdepa
- 21
- 4
1
vote
0 answers
Lavarel Auth session lost after request
We try to authenticate a user manually via the builtin Auth functionality.
We don't retain a database as that's not needed for our purpose.
We followed this part of the docs:…

Mathias Maes
- 461
- 1
- 6
- 17
1
vote
0 answers
How to reliably detect an expired Laravel session?
I am working on a web client which does a lot of AJAX request. The backend is written in Laravel. If the backend throws a PHP exception, the backend sends a JSON response to the client whose header shows a HTTP error code and whose body includes the…

user2690527
- 1,729
- 1
- 22
- 38
1
vote
0 answers
Shared session between 2 Laravel apps is not working
I have 2 Laravel applications
Application 1 is based on Laravel 5.4
Application 2 is based on Laravel 8
both apps connect to the same database and both share the same APP_KEY value
both apps have this in the .env…

J. Duo
- 127
- 3
- 10
1
vote
1 answer
Change Laravel Session Driver from Cookie to Database
I would like to change the Laravel Session Driver. The application is already up and running. There is a helper class with getters and setters and modifiers that accesses the session.
My question
How do I change the driver from cookie to database?…

Maik Lowrey
- 15,957
- 6
- 40
- 79
1
vote
1 answer
Null is given when trying to find data from pivot table
I have a Many To Many relationship between User & Wallet Models:
Wallet.php:
public function users()
{
return $this->belongsToMany(User::class,'user_wallet','wallet_id','user_id')->withPivot('balance');
}
User.php:
public function…
user9277271
1
vote
1 answer
How to check session value at Blade
I'm working with Laravel 5.8 and I want to set a session variable at cart.blade.php Blade, like this:
@php
$conflicted = '';
@endphp
@if($conflicting && ($prd[0]->prd_delivery == 'city_free_delivery' || $prd[0]->prd_delivery ==…
user9277271
1
vote
1 answer
How to programmatically login in Cypress for PHP larvavel session website
I writing testing code in Cypress.
UI login has been tested with no problem, but in order to test other parts of the website, I'd like to programmatically log in for quick testing.
The website is written in PHP and uses laravel session in the…

michelle2014
- 23
- 5
1
vote
1 answer
Laravel does not display validation errors when using $request->validate
I am not able to display the validation errors on a specific form/page when using $request->validate($rules);. Here is the controller code:
public function store(Request $request) {
$rules = [
'dummy-field' => 'required|string',
];
…

gbalduzzi
- 9,356
- 28
- 58
1
vote
1 answer
Laravel 8: set session lifetime in middleware
I found couple of instructions how to set the session lifetime dynamically in a middleware. I created a middleware which set the config "session.lifetime" depending on the route name and put it on the top of all my middlewares so it will be called…

peta
- 11
- 2
1
vote
1 answer
How to get row id & delete that particular row from Laravel Session Array?
i want to delete a row from stored session array.
I could successfully delete it by sending the row number statically like in the code line below. But here i want to do it dynamically by passing the Array Row ID or line number. I want to replace the…

Thoufeeq
- 11
- 2