Questions tagged [laravel-session]
101 questions
1
vote
0 answers
Laravel session changes does not persist after 2 page reload/redirect
When i delete or create data from database I save messages in session like this
/**
* Function that saves the response to the session
* @param Bool $bResult
* @param $sAction
*/
private function storeResultToSession($bResult, $sAction)
{
…

Nicodemus Rada
- 11
- 4
1
vote
1 answer
how to update session data in Laravel (session cart)
i am making an e commerce shopping cart where i have used session to store cart item. But the problem is when i am trying to update (increase or decrease) cart item's quantity i am not getting the accurate total price. i am trying to update the…

Rajin
- 3
- 3
1
vote
1 answer
How to solve auto logout problem in Laravel
I have two projects running in the same shared hosting (Namecheap Reseller hosting), have SSH access. Laravel version is 5.4. In both projects, using database driver for session and cache. I have changed the cookie name for both projects. But I am…

Eliyas Hossain
- 550
- 4
- 19
1
vote
1 answer
Multi-step form in Laravel
I am trying to create a multi-step form for a user to fill after logging in. I created separate pages with forms that will be a part of the common form.
The data will be saved in the "users" table.
I am new to Laravel and I followed this:…

andrea
- 39
- 2
- 8
1
vote
0 answers
Laravel database sessions in phpunit tests
I'm currently working on a feature where users can view all their sessions across devices. Now when trying to feature test this functionality, I´m doing the following:
(Note: I´m using Inertia and have a few test macros)
Create the migration:
php…

Stefan Beierl
- 21
- 3
1
vote
1 answer
Laravel session bug?
Why is that even though I forget a session already it stills prints its value when I press back button ?
Is this kind of a bug in laravel or am i doing something wrong with my code ?
here is how i forget the session…

Kabergrammer
- 9
- 1
- 4
1
vote
1 answer
How to retrieve all sessions "except" specified field in Laravel
I'm having a hard time searching on how to retrieve all sessions except specified field(s). I tried to search here but I can't find the answer. For example, I want to retrieve all below, except the password.
session([
'name' => 'John Doe',
…

schutte
- 1,949
- 7
- 25
- 45
1
vote
4 answers
What is the purpose of creating table for Laravel Session?
I am confused why it is prerequisite of creating a database table for session based on the documentation, when session can work without it (db table).
Someone could explain me,
I can directly session(['key' => 'value']); without the table, why we…

schutte
- 1,949
- 7
- 25
- 45
1
vote
1 answer
How to make auto Logged In off on creation of new user using auth() in laravel 5.7?
I'm making a project in which I want to create user through Laravel auth() but don't want to get it auto logged in on creation of account. I have copied the default register page into studentRegister and I want to register it through admin when he…

Abdul Rehman
- 159
- 1
- 2
- 18
1
vote
1 answer
Remembering Results When Navigating Back to Search Page in Laravel
I have created a search page using Laravel that has "text to search" filters at the top. When the mouse is taken off the filter the page's JavaScript fires an Ajax call then returns the results.
As I also have pagination enabled (with Ajax), when I…

Sachin
- 117
- 1
- 10
1
vote
1 answer
Laravel Verification Link With Session
I need to redirect back with a message.
Active link sent successfully.
request another
How do I create a session to link if I'm not using any form?

Kareem Elsharkawy
- 429
- 5
- 17
1
vote
3 answers
Laravel 5 Session Doesn't Work on Redirect
I am having trouble with developing a Laravel application. When I set a session from a function and loaded the view the session will show:
Session::flash("test","ABC");
return view('layout.customer');
But when I set a session and redirect it to a…

nuz123
- 11
- 1
- 5
1
vote
3 answers
Change item of a session array in Laravel
I'm using Laravel 5.6, using session array to store the user details after login.
user_date = array:19 [
"userEmail" => "user@user.com"
"username" => "userwebtest"
"role" => "user"
"gender" => "male"
"profilePic" =>…

silverFoxA
- 4,549
- 7
- 33
- 73
1
vote
1 answer
How to include a CSRF Token in get route in Laravel tests?
To prevent CSRF attacks, I'm adding a state parameter with my current CSRF token to an external link. When the external page redirects the user back to my site, it will include the state.
With a simple condition I can check it in my…

Philipp Mochine
- 4,351
- 10
- 36
- 68
1
vote
1 answer
Where should I store the Laravel Session data based on the MVC pattern?
I'm working with the Laravel integrated to the WordPress and struggling to understand where should I put the session data based on the MVC design pattern?
Back in the day, I used to put everything inside the view (header.php and footer.php) files…

Puka Unknown
- 45
- 7