Secure CSRF Token Manager
Creates and stores a scoped CSRF token with expiration and rotation support.
Open FunctionReusable pure PHP functions for everyday application and LAMP stack work.
Creates and stores a scoped CSRF token with expiration and rotation support.
Open FunctionValidates a submitted CSRF token against the stored session token and returns a clear pass/fail result.
Open FunctionTracks request attempts by key and determines whether a request should be allowed or delayed.
Open FunctionWrites normalized security events without exposing sensitive values.
Open FunctionBuilds an internal redirect URL only if the target matches approved local paths.
Open FunctionScores a password against length, entropy, reuse, blacklist, and composition rules.
Open FunctionVerifies modern password hashes and upgrades legacy hashes after successful authentication.
Open FunctionChecks whether a session still matches expected browser/IP risk signals without hard-locking mobile users.
Open FunctionBuilds consistent cookie settings for secure, HttpOnly, SameSite, and lifetime flags.
Open FunctionCreates a strict but configurable CSP header from approved local and external service sources.
Open FunctionSends standard hardening headers for content type, frame policy, referrer policy, and permissions policy.
Open FunctionClassifies request input by expected context such as email, slug, integer, URL, HTML text, or plain text.
Open Function