25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
684B

  1. <%
  2. '=======================================================================================================================
  3. ' CSRF helpers: thin wrappers over the core HTMLSecurity token (one token per form family name, stored in the session)
  4. '=======================================================================================================================
  5. Function Csrf_Token(name)
  6. Csrf_Token = HTMLSecurity().GetAntiCSRFToken(name)
  7. End Function
  8. ' True only for a non-empty token that matches the session's token for this form family.
  9. Function Csrf_Valid(name, token)
  10. Csrf_Valid = (Len(token) > 0 And HTMLSecurity().IsValidAntiCSRFToken(name, token))
  11. End Function
  12. %>

Powered by TurnKey Linux.