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

binhchay1's avatar

Laravel create 2 session table

Hello everyone, I'm using Laravel 7.x. I want to create 2 session table for my bussiness. One for selenium and one for login. How can i create it ? i need to use default table for selenium and another table for login. Thank for attention

0 likes
6 replies
jlrdw's avatar

Are you referring to guards?

2 likes
binhchay1's avatar

@jlrdw Thank for reply. I am also looking to handle it through guards. But is there another way to handle it?

jlrdw's avatar

@binhchay1 from the documentation:

https://laravel.com/docs/11.x/authentication#introduction

At its core, Laravel's authentication facilities are made up of "guards" and "providers". Guards define how users are authenticated for each request. For example, Laravel ships with a session guard which maintains state using session storage and cookies.

But I think applying authorization would work after login.

2 likes
binhchay1's avatar

@jlrdw Sr, maybe you misunderstood what I meant. I want to create 2 session tables to store 2 sessions with different purposes. 1 session to store login processing session, 1 session to store custom session. My custom session is created when I launch webview by selenium. It does not go through authen. But now both of those processes save the session into the default session table.

binhchay1's avatar

@jlrdw Thank you so much. Maybe i didn't research the right keyword.

1 like

Please or to participate in this conversation.