1

I have two projects running in the same shared hosting (Namecheap Reseller hosting), have SSH access. Laravel version is 5.4. In both projects, using database driver for session and cache. I have changed the cookie name for both projects. But I am facing two serious problems.

  1. It automatically logged out authenticated users after a few minutes.
  2. There is a blog part of it. If an authenticated user posts something, it showing another authenticated user posted it.

session.php (thefinancialexpress.com.bd)

<?php

return [

    'driver' => env('SESSION_DRIVER', 'file'),

    'lifetime' => 120,

    'expire_on_close' => false,

    'encrypt' => false,

    'files' => storage_path('framework/sessions'),

    'connection' => null,

    'table' => 'sessions',

    'store' => null,

    'lottery' => [2, 100],

    'cookie' => 'fe_online',

    'path' => '/',

    'domain' => env('SESSION_DOMAIN', null),

    'secure' => env('SESSION_SECURE_COOKIE', false),

    'http_only' => true,
];

.env (thefinancialexpress.com.bd)

BROADCAST_DRIVER=log
CACHE_DRIVER=database
SESSION_SECURE_COOKIE=true
SESSION_DRIVER=database
QUEUE_DRIVER=sync

session.php (today.thefinancialexpress.com.bd)

<?php

return [

    'driver' => env('SESSION_DRIVER', 'file'),

    'lifetime' => 120,

    'expire_on_close' => false,

    'encrypt' => false,

    'files' => storage_path('framework/sessions'),

    'connection' => null,

    'table' => 'sessions',

    'store' => null,

    'lottery' => [2, 100],

    'cookie' => 'laravel_session',

    'path' => '/',

    'domain' => env('SESSION_DOMAIN', null),

    'secure' => env('SESSION_SECURE_COOKIE', false),

    'http_only' => true,

];

.env (today.thefinancialexpress.com.bd)

CACHE_DRIVER=database
SESSION_DRIVER=database
QUEUE_DRIVER=sync

Please help me to solve this problem.

Thanks & Regards

Eliyas Hossain
  • 450
  • 4
  • 16

1 Answers1

0

In your config/session.php you can increase the lifetime, Eliya in your .env file set SESSION_LIFETIME to a higher number as per your requirement.

'lifetime' => env('SESSION_LIFETIME', 120), //120 minutes

'expire_on_close' => false,