简体   繁体   中英

AngularJS, Laravel REST API

Im playing with Angular and laravel, so I have this RBAC Package of my own, and Im trying to make it work in a Rest way... I'm barely learning this... so my question is...

My package depends on php sessions, where an array with user roles and permissions is stored, so each time I run my filter to determine if the use should perform an action over a resource of the application or not it reads the session instead of querying the DB every time.

So... I have my routes functioning and all, but is there a way to access the user session through curl? ... better question is there a way to keep the user logged in so that way laravel knows where the session is store at?

I am not sure this is what you want, but, PHP stores your session id as a cookie. And, curl can load cookies from a file . So, if you store your session id in a cookie file, and tell curl to load the cookies from that file, your problem is solved.

I hope this gives you a hint.

EDIT:
Laravel stores it's session coookie as laravel_session .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM