title: how to set cookies as secure flag in spring boot
body: <p>I am working on spring boot and completely unaware how it's work . while authenticating the login JSESSIONID is created as cookie . Login code is as below</p>
  
  <pre><code> protected void configure(HttpSecurity http) throws Exception {
      http
              .formLogin()
              .loginProcessingUrl("/authenticate")
              .usernameParameter("username")
              .passwordParameter("password")
              .loginPage("/")
              .permitAll()
              .and()
              .logout()
              .permitAll()
              .and()
              .authorizeRequests()
              .antMatchers("/index.html", "/home.html", "/login.html", "/app/**", "/js/**", "/css/**", "/fonts/**", "/favicon.ico", "/").permitAll().anyRequest()
              .authenticated().and().csrf()
              .csrfTokenRepository(csrfTokenRepository()).and()
              .addFilterAfter(csrfHeaderFilter(), CsrfFilter.class);
  }
  </code></pre>
  
  <p>How to make the cookie have secure flag </p>