Thanks @niosus for posting possible solution, however, I found another way on which we do not need to hack the core file like wp-login.php as it will be overwritten when updated and besides testcookie have different security perspective. Here is what I did.
In function.php of theme I added:
//fix for cookie error while login.
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
if ( SITECOOKIEPATH != COOKIEPATH )
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
Hope this will help others as it solved in my case.