How to configure HTTPonly Flag

How to configure the HTTPonly flag set for the cookie in the application ??
When a cookie is set with the HttpOnly flag, it instructs the browser that the cookie can only be accessed by the server and not by client-side scripts.