Answer the question
In order to leave comments, you need to log in
How to get the session token from the received values?
Hello, I decided to decrypt Laravel cookies without actually using it. I looked at how they are decrypted in their file and wrote an analogue:
function decrypt($payload = 'cookie')
{
global $key;
$payload = getJsonPayload($payload);
$payload['value'];
$iv = base64_decode($payload['iv']);
echo $decrypted = openssl_decrypt($payload['value'], 'AES-256-CBC', $key, 0, $iv );
}
67e37f4b5c997344e6d31dfw36ce023260238be6|QxWrlAcjHN7hngfzJK4afyhnCleZaFR6QnafMjwF
bI3YAIr8pPeW4lWv1bZ1cSFTqhN3firZIdoFEZMUwNol4D42f7dGJAZfn0Qu
Answer the question
In order to leave comments, you need to log in
According to src/Illuminate/Cookie/Middleware/EncryptCookies.php
"67e37f4b5c997344e6d31dfw36ce023260238be6|" === hash_hmac('sha1', $cookieName'v2', $key).'|';
$user->setRememberToken($token = Str::random(60));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question