authentication improvement, fixed no session cookie error