1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Laravel] セッションID名を変更する

1
Posted at

セッションIDとは、セッション情報にアクセスする際にキーとしての役割を持つクッキーのことです。認証の際に必要になります。

結論

.envSESSION_COOKIE を追加するだけです。(ここではabcdeという名前にしています)

SESSION_COOKIE=abcde

設定部分

config/session.php
'cookie' => env(
    'SESSION_COOKIE',
    Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),

コードからわかる通り、SESSION_COOKIE の値が優先されます。
SESSION_COOKIE が存在しなければ APP_NAME が使われます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?