mercredi 12 mai 2021

Laravel. What is a token in HTTP requests?

In Laravel documentation this middleware checks if the requests have a token with the name 'my-secret-token':

public function handle($request, Closure $next)
{
    if ($request->input('token') !== 'my-secret-token') {
        return redirect('home');
    }

    return $next($request);
}

What is this token in the HTTP requests? I looked in the HTTP RFC and tokens are mentioned but for a different purpose(Product Tokens).




Aucun commentaire:

Enregistrer un commentaire