Redis Sessions

Back to Redis sessions. Speed, baby, YEAH!
This commit is contained in:
Refringe 2024-07-05 17:52:23 -04:00
parent a36c38db43
commit 33ad76849e
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k
4 changed files with 11 additions and 18 deletions

View File

@ -43,8 +43,8 @@ DB_HUB_PASSWORD=
DB_HUB_CHARSET=utf8mb4 DB_HUB_CHARSET=utf8mb4
DB_HUB_COLLATION=utf8mb4_0900_ai_ci DB_HUB_COLLATION=utf8mb4_0900_ai_ci
SESSION_DRIVER=database SESSION_DRIVER=redis
SESSION_CONNECTION=mysql SESSION_CONNECTION=default
SESSION_LIFETIME=120 SESSION_LIFETIME=120
SESSION_ENCRYPT=false SESSION_ENCRYPT=false
SESSION_PATH=/ SESSION_PATH=/
@ -64,6 +64,7 @@ REDIS_HOST=redis
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
REDIS_QUEUE=default REDIS_QUEUE=default
REDIS_QUEUE_CONNECTION=queue
REDIS_CACHE_CONNECTION=cache REDIS_CACHE_CONNECTION=cache
SCOUT_QUEUE=true SCOUT_QUEUE=true

View File

@ -18,7 +18,7 @@ return [
| |
*/ */
'driver' => env('SESSION_DRIVER', 'database'), 'driver' => env('SESSION_DRIVER', 'redis'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -38,15 +38,6 @@ return new class extends Migration
$table->string('token'); $table->string('token');
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
}); });
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->primary();
$table->foreignId('user_id')->nullable()->index();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->longText('payload');
$table->integer('last_activity')->index();
});
} }
/** /**
@ -56,6 +47,5 @@ return new class extends Migration
{ {
Schema::dropIfExists('users'); Schema::dropIfExists('users');
Schema::dropIfExists('password_reset_tokens'); Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
} }
}; };

View File

@ -29,13 +29,15 @@
<x-section-border /> <x-section-border />
@endif @endif
<div class="mt-10 sm:mt-0"> @if (config('session.driver') === 'database')
@livewire('profile.logout-other-browser-sessions-form') <div class="mt-10 sm:mt-0">
</div> @livewire('profile.logout-other-browser-sessions-form')
</div>
<x-section-border />
@endif
@if (Laravel\Jetstream\Jetstream::hasAccountDeletionFeatures()) @if (Laravel\Jetstream\Jetstream::hasAccountDeletionFeatures())
<x-section-border />
<div class="mt-10 sm:mt-0"> <div class="mt-10 sm:mt-0">
@livewire('profile.delete-user-form') @livewire('profile.delete-user-form')
</div> </div>