fix a bug of setcookie, the cookie path should not has a slash at the end except the root path