Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

51
Views
duplicated cookies and wrong order used for http request

I am using Fetch API with {credentials:"include"} for requests described down bellow.

Also my HTTP server returning Access-Control-Allow-Credentials: true header.


I have a 3 domains:

  1. example.com
  2. application.example.com
  3. server.example.com

๐Ÿช server.example.com/sign-in will send a cookie key with Domain=example.com; HttpOnly=true; Path=/. The key is a encoded string with all possible permissions included.

As I found out the key is accessible from every single subdomain which is good. So application subdomain have key as well.

๐Ÿช But application.example.com/test will send a cookie key with Domain=application.example.com; HttpOnly=true; Path=/test which is a key with ->limited<- permissions included.

So the cookies for subdomain application looks like:

Name Domain Path HttpOnly
key .example.com / true
key .application.example.com /test true

The problem

The problem starts when I am trying to request server.example.com from application.example.com. The first cookie (wildcard) is used. But why? I am on application subdomain and also I have more relevant (the second) cookie.

about 4 years ago ยท Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!