fixed cookie names not being correctly compared with expected names,
added code for the automatc login by cookie