You have a lingering http://us.ard.yahoo.com in the first $loginurl , it should probably be a *.co.jp , you need to check the docs to know the correct URL to use..