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

karwan's avatar
Level 22

Sanctum Error

why sanctum only working in Firefox and not chrome?

0 likes
10 replies
Sinnbeck's avatar

@karwan and your problem is exactly the same? It works on your local machine but on production it fails? And it's run on different sub domains? And the same error?

karwan's avatar
Level 22

@Sinnbeck I didn't tried on production but even when I want to register a new user not working but on Firefox there is no problem

Sinnbeck's avatar

@karwan then tell us about the set up. What urls are you running the sites on? How did you set up sanctum?

karwan's avatar
Level 22

@Sinnbeck url(localhost:8000)

SANCTUM_STATEFUL_DOMAINS=localhost,localhost8080,localhost:3000,127.0.0.1,127.0.0.1:8000,::1

SESSION_DOMAIN=localhost

'paths' => ['api/*', 'sanctum/csrf-cookie','login','logout'],

'supports_credentials' => true,

xuma's avatar

@karwan I'm using similar setup and it works fine. localhost:8000 my laravel api localhost:8080 is vuejs frontend.

SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000,::1,localhost:8080,localhost:8000

In my frontend;

import axios from 'axios'
axios.defaults.withCredentials = true
karwan's avatar
Level 22

@Xuma really! maybe I made mistake but don't know where is it

xuma's avatar

@karwan I don't see localhost:8000 in your stateful domains.

karwan's avatar
Level 22

@xuma you are right and also I missed the : between localhost:8080 thanks alot many times I tired and gave up because this miss spelling

Please or to participate in this conversation.