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

rsensan's avatar

Laravel 5/Sentry 2 - session not pertaining accross domain/subdomain

In laravel 4.1: In file /app/config/session.php, When i gave domain => 'domain.com' session could be access all over the sub and main domain. means, session can be readable in domain.com or user1.domain.com or user2.domain.com.

But in Laravel 5.0: session no pretaining accorss domain. Session set in user1.domain.com not able to read in user2.domain.com.

In file /config/session.php, When i gave domain => '.domain.com' But still its not working..

Could you please help me to solve the issue.?

0 likes
2 replies
rsensan's avatar

Thanks, but thats not my requirement.

In a browser user can login to only one domain. If they logged in user1.domain.com, then they cannot view user2.domain.com. If they tries from different domain, they will be redirect to current session domain. Our site have unique domain for each register user.

I have worked two sites in Laravel 4.1, session pretain in subdomains. But I'm facing this issue in Laravel 5.0.

In file /config/session.php,

'domain' => '.domain.com', // 'domain.com' '*.domain.com',

'driver' => 'database' // 'file'

Nothing worked.. help me to solve the issue

Please or to participate in this conversation.