added decryption for cookies and saving cookies method in api