fixed a bug about cookie reading