C
C
ceeed2022-02-24 12:24:41
JavaScript
ceeed, 2022-02-24 12:24:41

Cookies are not saved on ios mobile devices, how to fix it?

I have a ReactJs application. To authorize the user, I store the default token in a cookie; upon authorization, the token is overwritten with the user's personal token. I am using axios. I have an interceptor hanging on a request

$api.interceptors.request.use((config) => {
    const token = Cookies.get('token')

    if (token) {
        config.headers.Authorization = `Token ${token}`
    }
    return config
})

And in the whole application, in all transitions between pages, everything is fine, but on mobile ios on the user page (only on the user page) for some reason it gives 401 errors. So in all browsers on ios, on PC and android everything is fine. Please tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question