0

I've recently decided to try and make a universal app with expo supporting ios, android and web altogether. I knew that there would be many hick ups along the way.. but I found the biggest problem from the start. I can see that there are few options as where to store the access token for apps such as secure store or asyncStorage, I just simply can't find a way to work with cookies or any client side store to put in the access-token.

As my app should have the stay logged in feature essentially, this will be a critical problem for the web client.

Does anybody know a good workaround this matter, or is there a way to keep the users logged in from the server side using the device / ip detail..?

Please enlighten me guys!

Peter
  • 45
  • 1
  • 7

2 Answers2

1

The web support is available in asyncStorage since v1.9.0.

So you can use it in recent versions of asyncStorage.

alpere
  • 1,079
  • 17
  • 26
0

I've managed to do this with AsyncStorage.

import AsyncStorage from '@react-native-community/async-storage';

/// Then inside your component make an asynchronous set
await AsyncStorage.setItem(['tokenName', tokenValue]);
AndreVitorio
  • 622
  • 1
  • 7
  • 18