ruby on rails - Using Redis for authentication tokens -


i making mobile app site users, in app, users need able sign in. this, creating remember token authenticate users on sign in. @ first thinking saving each token database , destroying when user signs out. when user signs in, have same token until sign out. saw somethings saying redis best way store tokens. question if time new token created when user signs in , time destroyed when user signs out, redis needed or saving database ok performance wise

redis enable fast access token data keeps key value pair in memory. also, in case need expire token after particular span of time redis allow set expiration time along key .thus need not perform explicit computation determine expiry time in order delete it.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -