Getting security redirect to work onload (with fallback).