Category : session

im using Laravel 8 with Ui/Auth. and i cant share session… with localhost:8000 sub1.localhost:8000 and sub2.localhost:8000 BROADCAST_DRIVER=log CACHE_DRIVER=file QUEUE_CONNECTION=sync SESSION_DRIVER=database SESSION_CONNECTION=system SESSION_DOMAIN=".localhost" SESSION_LIFETIME=120 . when i change save session to database and domain= to ".localhost" i can entry to localhost:8000 but after login say "EXPIRED" same in sub1.localhost:8000 and others subdomains and i have the ..

Read more

I’m building a Job Search web application using Laravel and Vue.js. I’m using Twilio’s Video SDK to add the ability for Employers and Candidates to have video interviews within our app. After speaking with a Twilio support agent, he said a common thing developers do to achieve this is to set the RoomName to something ..

Read more

My port server is my login interface. * http://127.0.0.1:8000/* That is my login part, after entering my details it will redirect me to my dashboard http://127.0.0.1:8000/dashboard. But if I remove the /dashboard from the url it returns me back to login even when I am still in session and hasn’t yet click the logout button. ..

Read more

I am trying to save a class object into session but somehow it is throwing the "Serialization of ‘Closure’ is not allowed" error. What can I do to fix it? Below is my code public function getAddToCart(Request $request, $id){ $listing=Listing::find($id); // $oldCart=Session::has(‘cart’)?Session::get(‘cart’):null; // // dd($oldCart); // // dd(Session::all()); $cart = new Cart(null); // dd($cart); $cart->add($listing,$listing->id); ..

Read more

I want to use Laravel Auth::logoutOtherDevices. I added IlluminateSessionMiddlewareAuthenticateSession::class to $middlewareGroups => web in kernal. When I use this in login function : public function login(Request $request) { Auth::attempt([ ’email’ => $request->input(’email’), ‘password’ => $request->input(‘password’) ], $request->has(‘remember’)); Auth::logoutOtherDevices($request->input(‘password’)); } All passwords in my database change and I can’t login with other accounts. 😐 Where is ..

Read more

Hi im having difficulty locating enabling browser session in laravel 8 jetstream. As per documentation, you should make sure that the IlluminateSessionMiddlewareAuthenticateSession middleware is present and un-commented in your AppHttpKernel class’ web middleware group: Then, you may use the logoutOtherDevices method provided by the Auth facade. This method requires the user to confirm their current ..

Read more

Suppose a situation in which, I have to run a command php artisan foo:bar. In my command I have something like this: public function handle() { // Some Query to the database using ‘pluck’ $valuesFromDatabase = [‘aaa’, ‘bbb’]; dd($valuesFromDatabase); } The first time this will lead to [‘aaa’, ‘bbb’]. Okay, now after 5 minutes there ..

Read more

Suppose a situation in which, I have to run a command php artisan foo:bar. In my command I have something like this: public function handle() { // Some Query to the database using ‘pluck’ $valuesFromDatabase = [‘aaa’, ‘bbb’]; dd($valuesFromDatabase); } The first time this will lead to [‘aaa’, ‘bbb’]. Okay, now after 5 minutes there ..

Read more

I am using Laravel 5.2 This is my sessions table. This is my session.php: <?php return [ ‘driver’ => env(‘SESSION_DRIVER’, ‘file’), ‘lifetime’ => 120, ‘expire_on_close’ => false, ‘encrypt’ => false, ‘files’ => storage_path(‘framework/sessions’), ‘connection’ => null, ‘table’ => ‘sessions’, ‘lottery’ => [2, 100], ‘cookie’ => ‘laravelsession’, ‘path’ => ‘/’, ‘domain’ => null, ‘secure’ => false, ..

Read more

I get this error Property [name] does not exist on this collection instance. while I’m trying to get items out of my ‘cart’. I don’t get why, maybe bacause I’m trying to get items out of an array? Here is my code: cart.blade.php @extends(‘layouts.app’) @section(‘content’) <h1>Cart</h1> @if (count($cart) > 0) <ul> @foreach ($cart as $product) ..

Read more

I added these middlewares in the kernel to use Laravel sessions protected $middleware = [ IlluminateSessionMiddlewareStartSession::class, IlluminateViewMiddlewareShareErrorsFromSession::class, ]; However I have a problem, each time I refresh a page, a new session is regenerated while the old one has not yet expired. I have well ‘lifetime’ => env(‘SESSION_LIFETIME’, 120), ‘expire_on_close’ => false, in my config ..

Read more

I have already a session table called ci_sessions with this structure CREATE TABLE `ci_sessions` ( `id` varchar(128) NOT NULL, `ip_address` varchar(45) NOT NULL, `timestamp` int(10) unsigned NOT NULL DEFAULT ‘0’, `data` mediumblob NOT NULL, PRIMARY KEY (`id`), KEY `ci_sessions_timestamp` (`timestamp`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; How can i use this on Laravel to store my session ..

Read more

I have uploaded my project to CPanel, and everything was working smoothly. However, I noticed that after login the exceptions where I used if (Auth::check() && Auth::user()->id) {…} else{…} if (Auth::check() && Auth::user()->role_id === 1) {…} else{…} if (Auth::check() && Auth::user()->role_id === 1) {…} else{…} does not appear but everything works fine without any errors. ..

Read more

I wanna try to get data from users Session. In sessions.php – i was write driver -> database and in file .env repeat this. Next i’ll use php artisan table:sessions and create default Sessions Table look’s like this (with custom fields) public function up() { Schema::create(‘sessions’, function (Blueprint $table) { $table->string(‘id’)->primary(); $table->foreignId(‘user_id’)->nullable()->index(); $table->string(‘ip_address’, 45)->nullable(); $table->string(‘country’)->nullable(); ..

Read more