What is the use of CSRF tokens in Laravel?

What is the use of CSRF tokens in Laravel?

a) To manage routing
b) To protect against Cross-Site Request Forgery (CSRF) attacks
c) To encrypt session data
d) To handle form validation

Answer:

b) To protect against Cross-Site Request Forgery (CSRF) attacks

Explanation:

Laravel uses CSRF tokens to protect web applications against Cross-Site Request Forgery attacks by ensuring that the authenticated user is the one making the request.

Reference:

Laravel Quiz – MCQ – Multiple Choice Questions

Scroll to Top