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

mk_416's avatar

session domain setting for laravel 5.2

the session.php has a domain setting. that looks like

'domain' => null,

The default setting works with site like "abc.com" but not work for "www.abc.com".

the site doesn't work for "abc.com" if I change that to 'domain' => 'www.abc.com'.

how to do the domain setting if I need the site work for both "abc.com" and "www.abc.com".

Thanks for help

Mark

0 likes
2 replies
mk_416's avatar

Please help me. I have not fixed the issue.Thanks

Snapey's avatar

You would be better having your web server redirect one to the other. I know this is not addressing your question, but it does not help your SEO to have duplicate content on both abc.com and www.abc.com

Regarding your question, I always leave the session domain as null and then its not a problem.

1 like

Please or to participate in this conversation.