320 questions
0
votes
1
answer
51
views
Secure HttpOnly cookie not set in production environment
I developed a JWT based authentication that sends tokens in httpOnly, secure cookies. Here is the response of my login request:
access-control-allow-credentials
true
access-control-allow-headers
...
0
votes
0
answers
126
views
Capacitor (React + Android emulator) not sending HttpOnly cookie back to server, works fine in browser
I have a React web app that I’m running inside a Capacitor container. The backend issues an HttpOnly cookie (refresh_token) for authentication.
When I test in a normal browser, everything works:
...
0
votes
0
answers
65
views
Cookies in localhost
I am having difficulties with the following scenario.
I have an API that generates tokens and responds with an HTTPOnly cookie. This API is in a development environment (Cloud Server) at the URL https:...
1
vote
0
answers
78
views
Httponly cookies expire soon in classic asp
I tried to secure an old website in classic asp which was using this code to generate a cookie but does not care about httponly and secure , however the expiration date was working fine and cookies ...
0
votes
1
answer
56
views
httpOnly cookie with React NodeJS not sending cookie to server by applying the network IP address
I have a React-App with a Nodejs backend which handle authentication/authorization by using httponly cookie.
I created a static site and deployed it on NodeJS backend app, and it is working fine with ...
0
votes
1
answer
62
views
Unable to set the httpOnly cookie in the browser and send it back to server using javascript fetch
I am having Issues with receiving and sending httpOnly cookie - on the login Page
var response = await fetch(BASE_URL + 'login?useCookies=true', {
method: 'POST',
credentials: 'include',
...
0
votes
1
answer
75
views
Browser ignoring Set-Cookie
I have frontend running at https://fe-qa.mydomain.com and backend at https://qa.mydomain.com.
In the Chrome Dev Tools under Network, I can see that when frontend calls https://qa.mydomain.com/foo/bar2,...
2
votes
1
answer
150
views
handle JWT refresh with SignalR when using HttpOnly cookies
I'm using SignalR in a React frontend with JWT tokens passed via HttpOnly cookies for authentication, which prevents access to the token in JavaScript.
When the server is down for too long, the JWT ...
0
votes
1
answer
178
views
What is the point of http-only cookies and how to make your authentication secure?
EDIT: Incorrect question. I was getting only an empty object at the backend due to misconfiguration. I thought it was a part of HTTP-ONLY to make cookies inaccessible. (I cannot delete the question)
...
1
vote
1
answer
1k
views
How can I add an origin to CORS in strapi v5?
I am facing the CORS error (The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.) because origin was set ...
1
vote
0
answers
95
views
NextJS Auth0 add JWT token to client side requests
I Have a NextJS 14 SSR app, which uses Auth0 for authentication, using the @auth0/nextjs-auth0 library to manage authentication. I also have an external .Net Api with protected endpoints that ...
0
votes
1
answer
464
views
Deleting an httpOnly cookie via route handler in next js app router
I'm trying to remove and httpOnly Cookie that I set on serverSide of my nextjs project ,but when I can't remove it at all. I don't get any errors.
I tried to use route handler so that i can remove it ...
0
votes
1
answer
128
views
Cant send back httpOnly cookie to server
So I am implementing the JWT access token / refresh token cycle. I send a refresh token in an httpOnly cookie and I want to send it back to the server.
The httpOnly cookie appears in the response 'Set-...
-1
votes
1
answer
555
views
Next JS Access to HTTP-only cookies from the client
While rewriting an app from CRA to Next.js, I encountered an issue with using a JWT access token for client-side requests.
Previously, the token was stored in localStorage, making it easy to add to ...
0
votes
0
answers
32
views
Pass cookie to a fetch request on a different subdmain
Say I have a html page on mycooldomain.com. On that page I do login to login.mycooldomain.com using axios.
const smartAxiosLogin = axios.create({
timeout: 5000, // 5 seconds
...
1
vote
1
answer
535
views
How do I implement HTTPOnly stored JWT Tokens into my React app
I am quite new to React and I tried connecting my backend (Python/ Flask) to my frontend (React). I wanted to use JWT Tokens and save them in the HTTPOnly Cookies, I managed to write some code that ...
1
vote
1
answer
423
views
401 Unauthorized, react client does not send HTTP-only cookie back to the express server
I have a bug that I can't get out of in React and Express...
The problem: Status Code: 401 Unauthorized.
server configured with HTTP-only cookies and cores.
The token is received by the client but the ...
0
votes
2
answers
452
views
How to send a Bearer Token from front-end to back-end
My back-end is already working ,I tested it in Postman but I don't know how to get the Bearer Token,which is in front-end; I am using httpOnly and withCredentials.
NODE:
MiddleWare:
const jwt = ...
1
vote
0
answers
96
views
Issue with HttpOnly Cookie Not Being Set in Browser
I'm experiencing an issue where an HttpOnly cookie set by my backend is not appearing in the browser's cookie storage. The Set-Cookie header is present in the server's response, but the cookie value ...
0
votes
0
answers
143
views
401 Unauthorized. Laravel Sanctum. Cookie based authentication
I am trying to authenticate with the http only cookies. My front end is VUE 3 and backend is laravel.
I am successfuly logging in. My login functions is
public function login(Request $request)
...
0
votes
0
answers
70
views
Spring Boot check isHttpOnly cookie not working
I'm storing my authentication token on an http-only cookie. When an user logs-in, an http cookie carrying the token will be set. Here's the code to process the login:
@PostMapping("/processlogin&...
0
votes
1
answer
61
views
Is still safe have 2 cookies with the same information and name but one has httponly enabled
I have a asp classic site, I want to set the httponly enabled to the cookies ASPSESSIONIDxxxx, I applied this in general.asp file which is called when the site is loaded:
AspSessionCookie = Request....
1
vote
0
answers
188
views
Http Only cookies in node express with JWT and react frontend
I have a node express server which use JWT for auth. I originally just added the token in local storage in my frontend, but have now tried to implement HTTP only cookies.
My server is hosted on heroku ...
0
votes
1
answer
892
views
Stealing Cookies with XSS when HTTPOnly and CSP is enabled: Workarounds and Strategies
How can I steal cookie when HTTPOnly is on and CSP rules are defined? Assume that an attacker is given an inputfield that performs HTTP and that it is vulnerable for XSS attacks:
<form action="...
1
vote
0
answers
46
views
Can more than one client be authenticated with an HttpOnly Token
The httponly token is stored in the browser, so if I have two clients running in the same browser accessing the same API, once one of them is authorized to access API methods that require ...
1
vote
0
answers
215
views
Angular Client not able to include HTTPOnly cookie in requests to PHP server
Client Side is running on 4200 and Server side is on port 80
My index.php headers are
header('Access-Control-Allow-Origin: http://localhost:4200');
header('Access-Control-Allow-Methods: *');
header(&...
-1
votes
1
answer
444
views
how do i send httponly cookie with fetch request in nextjs
I've completed a guide and now aim to retrieve user details using a server component. However, despite the cookie being present in the browser, it doesn't seem to appear in the request.
I customized ...
0
votes
0
answers
149
views
httpOnly cookies are shown in browser console
My express app is running on localhost:4000 and is setting two cookies like this:
res.cookie('accessToken',token, { maxAge: 3600000, httpOnly: true, secure: false,Path: './',SameSite: 'None' });
res....
5
votes
2
answers
570
views
React & Django - WARNING:django.request:Forbidden: /api/user - SessionAuthentication - CSRF token not updated
UPDATE: I'm simplifying this as it got too long
I am trying to get SessionAuthentication to work with React (port 3000) and Django (port 8000). However, I am having trouble with csrftoken not being ...
2
votes
1
answer
2k
views
HTTPOnly session cookies can be read + accessed within Flutter?
I'm currently developing a mobile app using Flutter for iOS and Android for a customer whose application already exists for the web + has been setup in the form of a REST API already. The idea is to ...
1
vote
2
answers
1k
views
How can I authenticate user token in Angular Guard if I am using Http-Only?
I know that the safe approach to work with auth tokens is to use Http-Only, because with that, the JWT token will be read and set only on the server side. Ok, that makes sense to me.
My problem is: ...
0
votes
0
answers
67
views
ReactJS and access tokens
I want to store my refresh token in react, but I'm not sure where to store it. I've heard that it's best to store it in "HttpOnly" cookies. But I know it's not possible.
I saw online to ...
0
votes
0
answers
98
views
How to use express session to set-cookie in browser? cause when iam setting its getting rejected by browser
`I am running backend in a k8s cluster and ingress-nginx. The cookie is getting send to the browser. Confirmed with postman. But browser is rejecting it.
app.use(
session({
secret: 'keyboard cat',
...
1
vote
1
answer
60
views
httpOnly Presisting Authentication token status between DRF and reactJS
I seem to be having trouble persisting my athntication status between django and reactjs ( when i refresh the page ) i loose authentication.
upon sending requests to my endpoints in postman with my ...
0
votes
0
answers
280
views
HttpOnly refresh token cookie not being included in the request header despite withCredentials: true
Hi anyone who would be willing to help,
I'm using a refresh/access token system for authenticating requests for my c# api but I am having a problem with my HttpOnly refresh token cookie not being ...
0
votes
1
answer
194
views
Use of popup windows when the destination cookie is HTTPOnly
I have a Javascript script that opens a popup window passing a JWT token to a page.
This page uses the JWT token and creates a session, storing its ID in a cookie.
Once this is done, I am ...
0
votes
0
answers
170
views
Why is my HttpOnly cookie not stored in the browser for cross site domains?
I would like to save my HttpOnly cookie that I get from the backend in the browser. However, this is not happening and I don't know why.
In my Spring Boot (Java) app, I added the HttpOnly cookie in ...
0
votes
1
answer
723
views
How do I validate JWT sent to client in secure, httponly cookie?
In my NodeJS application RESTful API when user logs in I create a JWT and send it to the client in a secure, httponly cookie:
const jwt = utils.createJWT(user._id.toString());
const sessionId = utils....
1
vote
1
answer
426
views
I have renamed my csrftoken using django's CSRF_COOKIE_NAME, I made similar changes in front end. But X-CSRFToken is missing in req headers
I am using two django instances. Both of them are setting the same csrftoken variable, which is causing conflicts. One of the csrftoken cookie is overwritten by other csrftoken cookie. So I am getting ...
0
votes
1
answer
41
views
Cookie not setting in the browser but workers in postman (Express js)
am sending the cookie from the backend API (http only cookie ). when I sent the request using postman the cookie setts in the header (Set-Cookie) but when I try sending the request from frontend using ...
2
votes
2
answers
2k
views
Missing HTTPOnly Cookies at HTTP Request from child iFrame or pop-up window
Browser (Chrome) doesn't set HttpOnly cookies from child iframe or pop-up window
I have a parent webpage with a child iframe:
Parent at https://sub1.some-domain.com
Child at <iframe src="...
0
votes
1
answer
61
views
Why only http cookie works with postman and not with my local host in reactjs
I'm developping an app in mern stack using http only cookie request and while handling it in frontend it doesnt work but in postman it is working
And here is the coode for generating token
import jwt ...
0
votes
1
answer
1k
views
Cannot send httponly cookie using fetch
I'm trying to send HttpOnly cookie from React frontend to NodeJS backend. I have checked that if the cookie is not HttpOnly, everything works as expected, but if not then the server does not receive ...
3
votes
0
answers
972
views
Nextjs is neither receiving nor sending cookie to express js bakend
My front end app is in nextjs that run on port 3000 locally and backend is in express js that runs at port 3001 locally.
I used the same backend for my react js app, but there was not problem in ...
0
votes
0
answers
40
views
How to add HttpOnly Attribute for Sensitive Cookies in Jetty Server 8.1.3 [duplicate]
I am using Jetty server 8.1.3.
I need to add HttpOnly Attribute for Sensitive Cookies
((ServletContextHandler) context).setInitParameter("org.eclipse.jetty.servlet.SessionCookie", "...
0
votes
0
answers
2k
views
Why httpOnly true to store token with pinia-plugin-persistedstate not working?
I am implementing JWT Auth with Nuxt 3 (Only as Frontend), Pinia and Pinia-plugin-Persistedstate. I am storing access and refresh token on cookie. Everything works as long as i do not set httpOnly:...
2
votes
1
answer
1k
views
NextJS access httponly cookie before each fetch request on external API
In my NextJS app I use external API for user authentication and processing other API calls. I use Flask app as an external API. When login is performed to the NextJS app I sent credentials to API and ...
3
votes
1
answer
2k
views
Is storing JWT access token in app memory or both in httpOnly cookies?
I've always been under the impression that storing both of these tokens in an httpOnly cookie is secure enough, but been lately reading some people only store the refresh token in the cookie, and ...
1
vote
1
answer
3k
views
access Nextjs httponly cookie
I'm working on a Nextjs app and I'm using Laravel api for auth and other things.
So I was searching about the best way to store the token that i will get when I sign a user in or sign him up from that ...
0
votes
1
answer
93
views
Is it possible to have several 2 cookies headers. One with httponly and one without
I am writing a php web application.
I want to set 2 values in a cookie with $_COOKIE.
The first value should be accessible to a javascript script.
But the second value must not be accessible to ...