Switched to localStorage and using the php version as a backup if an
exception happens.