AWS Deployment: Frontend JWT Cookie Issues on Deployed Backend

On AWS, the backend doesn’t read JWT cookies. Login succeeds but API calls return 403. See revised code examples below:

export const loadUserProfile = createAsyncThunk(
  'user/loadProfile',
  async (_, { rejectWithError }) => {
    try {
      const reply = await axios.get(`${API_SERVICE}/user/profile`, { withCredentials: true });
      return reply.data;
    } catch (error) {
      return rejectWithError(error.response?.data);
    }
  }
);
import jwt from 'jsonwebtoken';

const issueJwt = (uid, res) => {
  const jwtToken = jwt.sign({ uid }, process.env.SECRET_KEY, { expiresIn: '10d' });
  res.cookie('authToken', jwtToken, {
    maxAge: 10 * 24 * 3600 * 1000,
    httpOnly: true,
    sameSite: 'lax',
    secure: true
  });
};

export default issueJwt;

hey all, has anyone tried adjusting cookie domain settings? i had a similar issyu on aws and found it was due to domain mismtch. what tweaks did u try? keen to hear more if u got any other ideas!