.Net Core Use logout link instead of button preventig cross domain GET request
.Net Core Use logout link instead of button preventig cross domain GET request I know that using button instead of anchor link in _LoginPartial.cshtml is to prevent cross domain GET requests, but I really need using anchor link to have a uniform nav-bar links. My question is: If I use anchor tag and use javascript code to call form submit method, will it be safe and prevent cross domain GET request? I mean replacing this code: <button type="submit">Logout</button> with this one: <a href="javascript:document.getElementById('logoutForm').submit()"></a> The point of the button is actually to submit the logout request via POST, since GET requests are idempotent and should not have any side effects. CSRF is just gravy on top. If you need a link, you can either style the button as a link (which is really the optimal path, as stylistic appearance is the domain of CSS, not HTML or JavaScript.) or you can use JavaSc...