Anyone? :D
How long is ONE api session?
Hi.
My question is around localization, and understanding the session length.
My understanding is, that when a user is login in with blade (non-api) the session length is until the user closes the browser tab.
Question: But when you have a API based frontend-SPA, that uses Axios (vue in my case). How long is ONE laravel session? I guess ONE api-session is equal to ONE request? is this correct? or how am I supposed to think of one api-session? (backend-laravel)
So there are three answers to this:
-
Using sessions (e.g: logging in not through an API). The session doesn't end when the user closes the tab, by default. It is an option in the configuration files tho. But the default session time is 2 hours.
-
Your front-end API (e.g: a first-party app), instead of authenticating itself on every request, it will usually store a cookie, which I believe also uses the default session time of 2 hours.
-
Using an API (e.g: third party), is stateless, thus auth is required on every request, therefore, yes, it is only valid for the one request.
Please or to participate in this conversation.