Updating templates to use cookies instead of sessions