CSRF token mismatch issue when deployed 2 same laravel project on the one server

55 Views Asked by At

I have a Laravel project working on my server with my-domain.com perfectly. I want to upgrade it to beta version, but won't reflect it to live until complete upgrade.

So I setup subdomain(ex: dev.my-domain.com) and copied my project to another directory, link it to subdomain.

After copied the existing project to new directory, I cleared the cache & cookie, sessions.

The second project display with sub-domain but the problem is that when I try to login I'm getting an error "CSRF token mismatch".

enter image description here

Note: When setting up a subdomain, I set the subdomain to point to the IP address of my server. So my main domain & sub-domain point to the same IP address for now.

The existing site is working perfectly, and if I replaced the directory name connected to the subdomain with the directory name of the existing site for testing, the new cloned project worked perfectly as the original my-domain.

I tried to set the cookie & path as different in "config/session.php" file but it not solved my problem.

This is driving me crazy. I did some research and looked at similar issues, but I couldn't find a solution that exactly matched my problem. Does someone have any ideas on this?

Thanks in advance.

0

There are 0 best solutions below