Questions tagged [laravel-session]

101 questions
0
votes
1 answer

How to get data from Sessions Table Laravel 8

have This code Session.php
0
votes
2 answers

Can't retrieve session in Laravel Blade view

I set up a controller to pass errors if validation fails and another message if passed it. if ($v->fails()) { return redirect('tickets/create')->withInput()->withErrors($v->errors()); } else { $ticket_id = $this->salvataggio($request); …
Roberto Remondini
  • 242
  • 1
  • 6
  • 19
0
votes
1 answer

Bug Cookie: laravel_session in owasp zap

I used OWASP ZAP software which enable you to test your website in attacking it , it finds security failures. So I did it to my Laravel Application 5.4 version and I have this error To be honest I don't really understand what I have to do to fix…
gigi603
  • 13
  • 1
  • 4
0
votes
1 answer

Why does custom guard get logged out on page reload/redirect?

I created a new guard for logging in custom type of users. I can login users with Auth::attempt('webguest'), but login does not persist over page reloads. It works only when I use web-guard. See for example my two test routes: Route::get('test1',…
0
votes
1 answer

How can I index all active sessions of a user in laravel and manage them?

I want to give users a capability to index his/her active sessions and terminate them on other devices. I am looking for something that is possible in messengers. Is there any way to do this?
SEYED BABAK ASHRAFI
  • 4,093
  • 4
  • 22
  • 32
0
votes
2 answers

How to assign value if not increment? laravel

I want to assign a value if not exist else increment the value. Below is the one line code that I'm trying to achieve. session()->put(['validation_count' => session('validation_count')++ ?? 1]); But I end up this error below. Can't use function…
charles
  • 364
  • 6
  • 18
0
votes
1 answer

Laravel: One IP per User, and how to give session to client IP from Laravel server

I'm beginner in Laravel Session, and little confuse with laravel session system, but I'm already make session stored to database: And then I have question: How to make 1 row session is dedicated for one user_id and one ip_address? so there is no…
0
votes
1 answer

Larave 6.x multidimensional arrays validation. old() function return empty array after validation

I have html-form that contains arrays. It has such structure: "q" => array:1 [▼ "new" => array:1 [▼ 1 => array:2 [▼ "name" => "a" "v" => array:2 [▼ 1 => array:1 [▼ "text" => "b" ] 2 => array:1 [▼ …
rela589n
  • 817
  • 1
  • 9
  • 19
0
votes
1 answer

Laravel 6 Session does not persist in web.php

Both of the files I put together in web.php so that they share the same web middleware. But the session does not Store I am create a SMS OTP system. In the API\SmsController@create function I run $rand =…
Shiro
  • 7,344
  • 8
  • 46
  • 80
0
votes
1 answer

laravel Session::flush not deleting session files inside storage/framework/sessions

My laravel website session is still stored in /storage/framework/sessions. after logout. I try to use Session::flush but its not working how I can delete these sessions.
user8747057
0
votes
1 answer

What can I use besides Sessions in order to use the following method as an API method?

I have a quiz app with a laravel back-end and Vue front-end. I am working on developing an API for this app. However, the problem I have encountered is that I need an API endpoint that: returns a question from Questions table - but it needs…
Adnan
  • 3,129
  • 6
  • 31
  • 36
0
votes
1 answer

I have a problem with storing large array in Laravel 5.6

Here is my problem. I store array in Laravel session. session(['array_cache' => $array]); Array looks like this one: array:59 [▼ 0 => array:18 [▼ "id" => 2 "type" => 3 "partner_id" => 1 "username" => "Pink11034519" …
Jeffz
  • 2,075
  • 5
  • 36
  • 51
0
votes
1 answer

Unique data input to Laravel session

To create a shopping cart, I would like to add the same product only once to my Laravel session. I have tried this condition within my controller, but it's still not working. Any ideas? Controller $sessions = Session::get('items.item'); foreach…
yassine j
  • 495
  • 1
  • 11
  • 27
0
votes
1 answer

Can't read sessions in ajax call

i am struggling with missing sessions after ajax call. Generally when page is loaded i see in debugbar all sessions: Of course I am interested in cartId. If session is present I want to use it to add product to given cart with $cartId. Here is…
Marek Kaliszuk
  • 577
  • 5
  • 21
0
votes
0 answers

Access to Session from AppServiceProvider

I have to access to the session and get some values and share it with all my views I have used following code on my AppServiceProvider.php, but it returns null when I read my session, Following code I have tried $errors =…
nuz123
  • 11
  • 1
  • 5