Added cookies support. Added processConfig function.