// Check if age verification is already done in this session const verified = await session.getItem('ageVerified'); if (verified === 'true') { return; // Already verified, allow access } // Show the age verification lightbox const result = await window.openLightbox('AgeVerificationLightbox'); if (!result || !result.isOfAge) { // Not of age or cancelled, redirect to age-restricted page await location.to(restrictedPath); return; } // Store verification in session storage await session.setItem('ageVerified', 'true');
top of page
bottom of page