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

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -