Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cipa's avatar
Level 1

Use Session instead of api_token

Hello,

I have a website where you login and sometimes I use apis to pass data to the frontend. I have it working with api_tokens(no refresh for now on the token) but I want to use sessions instead as the session is passed in the header when the request happens.

Solutions:

  1. Not use the api for these requests, but I plan in the future to maybe have a SPA
  2. Modify the way api works to also validate the session, anyone knows what I need to modify?
  3. Move the api in the web part of the app.

Any ideas on what would be the best solution, 1 seems the simplest one

Thank you

0 likes
3 replies
cipa's avatar
Level 1

Thank you, I could not find this in the Ecosystem tab on laravel's website but I heard of it and thought it might be an OATH solution.

bugsysha's avatar

I think that it is better to use Official Packages section in documentation for that purpose.

Please or to participate in this conversation.