set 'secure' flag to JSESSION id cookie

前端 未结 3 1730
悲&欢浪女
悲&欢浪女 2021-01-22 06:51

I want to set \'secure\' flag to JSESSIONID cookie . Is there a configuration in tomcat 6 for this ?

I tried by setting \'secure=\"true\"\' in \'Connector\' (8080) e

3条回答
  •  深忆病人
    2021-01-22 07:47

    For nginx proxy it could be solved easy in nginx config:

    if ($scheme = http) {
        return 301 https://$http_host$request_uri;
    }
    
    proxy_cookie_path / "/; secure";
    

提交回复
热议问题