Now handling cookies better