L
L
l4m3r2019-05-05 20:30:14
Laravel
l4m3r, 2019-05-05 20:30:14

Session guard or token guard for SPA?

I'm doing a simple SPA on Vue + Laravel (Rest API). There is a table of users and authentication by login and password.
By default, Laravel uses session guard for web and token for api.
I can't understand why there is a separation within the same project?
Can I use the session driver for ajax requests to the API? It's just not obvious to me what the advantages of the token are in my case. And it’s not clear at all why to separate routes, configs into api and web?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2019-05-05
@l4m3r

Because Rest Api is stateless
https://ru.wikipedia.org/wiki/REST
https://medium.com/@ermakovichdmitriy/%D0%BE%D0%BF...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question