Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any reason to have a session ID within a form?

is there any reason for me to place the session ID within a form, as a hidden form field?


Thank you everyone!! :)

like image 347
RadiantHex Avatar asked Jan 22 '23 08:01

RadiantHex


2 Answers

This is a part of one of the possible methods for preventing against cross-site request forgery attacks.

It can be used in the Synchronizer Token Pattern.

It can also be used in the "Double-Submit Cookies" method mentioned at the bottom of the page linked to above.

like image 90
David Avatar answered Jan 28 '23 05:01

David


The only reason would be to maintain session state for all users including the ones that have disabled cookies.

like image 43
Andre Goncalves Avatar answered Jan 28 '23 05:01

Andre Goncalves