laravel获取sanctum的cookie
$payload = json_decode(base64_decode('eyJpdiI6IkhqaWNhQmRTY3F3RC9Vc2Z4K3pHU1E9PSIsInZhbHVlIjoib2ZZQWxwRGxjSjBzazY4N29DTm12TjJyeWJOcXB1cUFaQ2psbU4vTlV5WkNET0V0VFZGcVIvRzE3eG1LZllzUkFIV256bVl5OStucU5NaEhtNktuL1pSUk50ZEFDdEpvZkphRzNSOHJuck1oTy9wWU45MnBkWXluUUZJclEzQXkiLCJtYWMiOiI1ODY5ZjFhNThlN2Q1NjE5MjMxNjFiNTFiMTA3NzZkNGIyM2EyNDAwOTNlMWRmYWRiNzcxMWRkYzAzMWJlNGYyIiwidGFnIjoiIn0'), true); Log::debug(print_r($payload, true));
[iv] => HjicaBdScqwD/Usfx+zGSQ== [value] => ofYAlpDlcJ0sk687oCNmvN2rybNqpuqAZCjlmN/NUyZCDOEtTVFqR/G17xmKfYsRAHWnzmYy9+nqNMhHm6Kn/ZRRNtdACtJofJaG3R8rnrMhO/pYN92pdYynQFIrQ3Ay [mac] => 5869f1a58e7d561923161b51b10776d4b23a240093e1dfadb7711ddc031be4f2 [tag] =>
laravel的sanctum操作方法定义在:
vendor/laravel/sanctum/src/Guard.php
src/Illuminate/Encryption/Encrypter.php
参考资料:
https://medium.com/geekculture/laravel-sanctum-with-custom-expiry-time-1b69984363e0