finally I found the reason! there isn't any problem with codes. this problem occurs in some hosts, especially in free hosts. they use a security method that creates this problem.
If you have a purchased host, and you got this problem, just contact your host provider and ask them to disable "testcookie-nginx-module".