Change URIPATH option to TARGETURI as per review
Check session and CSRF variables as per review