Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jewelhuq's avatar

How to destory customer session id dynamically

I know if we would use mysql database as session storage we could query and delete session id using user_id but how about redis. We are using redis in that case how can I remove particular customer session and forge him to logout

Schema::create('sessions', function ($table) { $table->string('id')->primary(); $table->foreignId('user_id')->nullable()->index(); $table->string('ip_address', 45)->nullable(); $table->text('user_agent')->nullable(); $table->text('payload'); $table->integer('last_activity')->index(); });

0 likes
1 reply

Please or to participate in this conversation.