Saturday, 30 January 2021

Session cookie not deleted on IOS tablet and smartphone

Using node.js express library to clear the cookie on logout

app.post('/logout', (req, res, next) => {
// cookie-session library used hence req.session = null is valid
            req.session = null;
            res.clearCookie('auth');
            res.end();
    });

Works perfectly on all desktop machines, Android devices but not on IOS device browsers (Firefox, Chrome, Safari, among others). All IOS testing devices are version 14+

Tried available options for clearCookie res.clearCookie function doesn't delete cookies to no avail.

However, using incognito mode on IOS devices works meaning the cookie gets cleared, also closing the browser (which clears the session) works.

When setting the cookie (login) I use the default

res.cookie('auth')

Does anyone have a clue to what's going on?



from Session cookie not deleted on IOS tablet and smartphone

No comments:

Post a Comment