Injecting state through cookies