write log and cookie in login dir