added redirect & fixed cookies, need to update doc