SDK: PHP
Suspicious login detection for PHP
Protect PHP login flows with real-time risk scoring.
Install command
composer require joshghent/loginllama:^1.3Add LoginLlama to PHP in one call
Call LoginLlama from your PHP login handler before you create the session. Send the email, IP, and user agent, then allow, challenge, or block based on the returned risk score.
<?php
// Install: composer require joshghent/loginllama
require_once 'vendor/autoload.php';
use LoginLlama\LoginLlama;
$loginllama = new LoginLlama(getenv('LOGINLLAMA_API_KEY'));
// Handle login request
$email = $_POST['email'];
// Check with LoginLlama BEFORE authenticating
$result = $loginllama->check($email);
if ($result['risk_score'] > 5) {
http_response_code(403);
echo json_encode(['error' => 'Suspicious login detected']);
exit;
}
// Continue with your existing auth logic...
echo json_encode(['success' => true]);Why teams choose LoginLlama for PHP
Score every login in under 100ms
Detect VPNs, proxies, and TOR exit nodes
Explain why a login is risky with clear risk reasons
Catch errors from the check and logins go ahead during an outage
How it works
Step 1
Install or connect LoginLlama
Choose the SDK or integration point that fits your auth flow and add your API key.
Step 2
Check risk at login time
Send the email, IP, and device context before completing authentication.
Step 3
Act on the risk score
Allow, challenge, or block the login based on risk score and reasons.
Signals we analyze
New device or browser fingerprints
Impossible travel and velocity checks
Bot-like login bursts and credential stuffing
Geo anomalies and risky IP reputation
Works well with your PHP stack
PHP login security FAQ
How do I add suspicious login detection to PHP?
Install LoginLlama with `composer require joshghent/loginllama:^1.3`, then call the risk check from your PHP login handler before you create the session. Send the user's email, IP address, and user agent, and branch on the returned risk score.
Will LoginLlama slow down PHP logins?
No. Risk scoring returns in under 100ms. If LoginLlama is unreachable the check throws an error, so catch it and let the PHP login go ahead. An outage then never blocks a real user.
What does LoginLlama detect on PHP logins?
New devices and browser fingerprints, impossible travel and login velocity, credential-stuffing bursts, and traffic from VPNs, proxies, TOR exit nodes, and high-risk IPs — each returned with a clear, human-readable reason code.
Does LoginLlama work with Laravel, Symfony, Custom PHP apps?
Yes. LoginLlama runs at the login step itself, so it works alongside Laravel, Symfony, Custom PHP apps and the rest of your PHP stack without replacing your existing authentication provider.
Other integrations
LoginLlama works with the same single API call across every stack.
PHP login protection
Protect PHP users from suspicious logins
Add LoginLlama in minutes and block risky logins in real time.