window.faceio.restartSession()
we using the restartSession feature to refresh the scanning session but we found out this function is unable working normally. sometime it able to refresh as a new session. but most of the time, it also not working. keep returning false. may i know how to refresh the scanning session?
window.faceio.restartSession() Not Working Properly
✓ Accepted Solution
Hello,
Please see notes and fixes below:
-
restartSession()
usage-
Call it only in
catch()
on failure (enroll/auth). Don’t trigger it inthen()
/finally()
after a successful flow. -
When the session is valid,
restartSession()
may returnfalse
(no reset needed). That is not an error. - Please note that
restartSession()
is designed to work only after a failed authentication or enrollment. You cannot call it at any time; it should only be invoked when your authentication or enrollment flow fails with an error code or if you want to staty on the same page on succesfull authentication or enrollment rather than sending the end user to his dashboard for example.
-
-
Error code 6 – “Calculated Facial Vectors do not match”
-
The matcher needs two stable frames of the same person. If vectors aren’t closely related (blur, motion, poor light, partial face, another face in frame), enrollment fails.
-
Fix: steady head for ~1s, even frontal lighting, face centered filling ~60–70% of frame, no occlusions, single subject only.
-
-
Glasses reduce success
-
Eye-landmark extraction can be impacted by glare, heavy frames, tinted lenses.
-
Fix: adjust lighting/angle to remove reflections; if policy allows, enroll once without glasses, then add a second pass with glasses; avoid backlight; use ≥720p camera.
-
-
Error code 5 – “Presentation (Spoof) Attack detected”
-
Triggered by PAD against print/screen/deepfake attempts.
-
False positives often come from strong reflections, displays near the face, or extreme exposure.
-
Fix: neutral background, diffuse lighting, keep monitors out of frame, correct exposure and retry.
-
-
Scaling/control needs
-
Given your requirements (threshold tuning, PAD sensitivity, fallback logic), you will need to order the On-Premises package for deeper parameter control. You can validate on cloud first, then migrate without changing front-end calls.
-
Best regards,