Laravel Sanctum API returns 403 for logged-in SPA users

Hi, looking for someone to help with laravel sanctum api returns 403 for logged-in spa users. Our Vue single-page app talks to a Laravel API with Sanctum cookie authentication. Login works, but later requests randomly return 403 ("CSRF token mismatch" or "Unauthenticated"), mostly after the user has been idle or on Safari. Domains are app.example.com and api.example.com. I suspect session domain, SameSite or stateful domain settings. I want it diagnosed against our setup, fixed, and covered by a couple of feature tests. Required skills: Laravel, PHP, Sanctum, Vue.js, API Authentication. Quick turnaround appreciated. Please let me know if you can jump on this right away.

Category: Development & Software

Skills Required: LaravelPHPSanctumVue.jsAPI Authentication

Budget Range: $50 - $50 USD

Experience Level: Entry level

Related Developer Talent & Ecosystem Links:

Development & Software Posted 11/20/2026 Practice Opportunity • Free Bid

Laravel Sanctum API returns 403 for logged-in SPA users

Project Deliverables & Description

Hi, looking for someone to help with laravel sanctum api returns 403 for logged-in spa users.

Our Vue single-page app talks to a Laravel API with Sanctum cookie authentication. Login works, but later requests randomly return 403 ("CSRF token mismatch" or "Unauthenticated"), mostly after the user has been idle or on Safari. Domains are app.example.com and api.example.com. I suspect session domain, SameSite or stateful domain settings. I want it diagnosed against our setup, fixed, and covered by a couple of feature tests.

Required skills: Laravel, PHP, Sanctum, Vue.js, API Authentication. Quick turnaround appreciated. Please let me know if you can jump on this right away.

Required Skills & Technologies

Sign In to Submit a Bid

Bidding is restricted to registered freelance users. Sign in to submit details, propose custom payment milestones, and lock funds in escrow.

Contract Parameters

Budget Setup

$50

fixed Rate Structure

Experience Level

Entry level

Target expertise level requested

Project Scope

Intermediate

Target project delivery scope

Contract Identifier: 23697e29

Professional Trust Score

ESCROW FUNDING SECURED$50 LOCKED

Client holds verified capital secured in project escrow holds.

Client Identity Verified

Corporate background confirmed

Escrow Lock Enforcement

Secure milestone hold verified

BotDigit Arbitrated

Arbitration protection active

HomeJobs
Get Started
ExploreSign In