The setSecure method of the Cookie class sets the security value for a Cookie object.
public void setSecure(boolean secure);