Skip to content

perf: limit cookie parse only on some cookie #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cesco69 opened this issue Apr 15, 2025 · 0 comments · May be fixed by #127
Open

perf: limit cookie parse only on some cookie #126

cesco69 opened this issue Apr 15, 2025 · 0 comments · May be fixed by #127

Comments

@cesco69
Copy link

cesco69 commented Apr 15, 2025

Hi, in my express I use only 1 cookie (API_TOKEN), but client side send varius cookie eg:

_ga_M9MSXKVJN9=XXXX; 
_ga_W98228BE06=XXXX; 
_gid=XXXX; _ga=XXXX; 
_gcl_au=XXXX; 
_ga_5MFMLYZHT2=XXXX; 
rxVisitor=XXXX; 
_ga_K4Y50QD36K=XXXX; 
dtCookie=XXXX; 
dtSa=XXXX; 
rxvt=XXXX; 
API_TOKEN=XXXX;

the _g* cookies are Google Analitycs / Google Tag Manage
the _dt* and rx* cookies are Dynatrace
the API_TOKEN is the only one used by my express!

Parsig all those cookies on each request has a performance impact!

The idea is introduce an option for limit the cookie parsing on a limit numer of cookies, eg.:

app.use(cookieParser({null, {
   allowedCookie: ['API_TOKEN']
}}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant