add cookie check for xap.pl, ask for the username and password if cookie check is failed.