Authentication and ajax

Posted 1 year ago by mistermat

I'm wondering how authentication works in Laravel, specifically with ajax requests. Is the logged in user info saved in the session? If so, does the session work with ajax requests?

I'd like to refer to a lesson: https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/32?autoplay=true

It seems that it just works even with ajax requests, but I would've expected ajax requests to be different from regular form submissions. How does Laravel know about the user on an ajax request? Would this be different if it was an SPA instead of a blade template?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.