Token Authentication vs. Cookies

前端 未结 8 1353
南旧
南旧 2020-11-29 14:49

What is the difference between token authentication and authentication using cookies?

I am trying to implement the Ember Auth Rails Demo but I do not understand the

8条回答
  •  囚心锁ツ
    2020-11-29 15:08

    Token based authentication is stateless, server need not store user information in the session. This gives ability to scale application without worrying where the user has logged in. There is web Server Framework affinity for cookie based while that is not an issue with token based. So the same token can be used for fetching a secure resource from a domain other than the one we are logged in which avoids another uid/pwd authentication.

    Very good article here:

    http://www.toptal.com/web/cookie-free-authentication-with-json-web-tokens-an-example-in-laravel-and-angularjs

提交回复
热议问题