updated to allow cookie permanent store