Reputation: 1331
I have a user authenticated in a laravel app. I have a third party app that needs to see if this user is authenticated in said laravel app. I see there is a cookie called laravel_session and the contents are something like:
eyJpdiI6ImZIdGo0XC9cL1I2RWpzOUppQmRqcTljNFZ0SFJNMTBrc3l5OTVIN12h3ks03RT0iLCJ2YWx1ZSI6InNMWXZCcm44N1pmVnpTWEU3WStEMTBNckJGUFdJVEJFY3lMWGNIdUVkS0p5RlwvNzJGVXVpVFEwZnNqSDdFc0c4d0hPOTIrSFA3UG1heFIxanZWWk1231209IiwibWFjIjoiYzc1MTQxNjEyMTU5MTdjZGE0NDYwOTY2OGExYTYxOTc0MjA5MmJhdsdhZDMwOGZjNmIzYjE0ZmQ4MDI3MjkwMCJ9
I see in the app/stoage/session directory, one file named 164d51a82e239ae352792311f24e29c3670bf027 which contains the correct serialized data for that user.
How do I associate the two without loading up any laravel classes/code? In other words, how do I find out which session file belongs to the user just by their cookie info?
Thanks!
Upvotes: 1
Views: 441
Reputation: 156
Laravel automatically encrypts it's cookies with PHP's mcrypt extension.
You can try modify Laravel cookies implementation but this is not recommended.
Maybe writing an artisan command that uses the Encrypter class will be the solution, or just find another way to achieve your goal.
Upvotes: 2