如何为inplay 2.1.0设置cookie的安全标志 [英] how to set secure flag for cookies inplay 2.1.0

查看:175
本文介绍了如何为inplay 2.1.0设置cookie的安全标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Play 2.1.0。我想为请求标头设置一个安全标志。我尝试使用https主机在application.conf中使用application.session.cookie.secure = true。但仍然没有在标题中设置安全标志。

I am using play 2.1.0. I want to set a secure flag for request headers. I tried using application.session.cookie.secure=true in application.conf with https host. But still the security flag is not set in header.

在互联网上找不到多少。

Did not find much on internet.

推荐答案

我手边没有随附Play文档的链接,但您正在寻找的配置属性是:

I don't have a link to accompanying Play documentation to hand, but the configuration property you're looking for is:

session.secure=true

你可以看看来源在2.1.x分支上查看Play如何使用此属性。

You can take a look in the source on the 2.1.x branch to see how Play uses this property.

这篇关于如何为inplay 2.1.0设置cookie的安全标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆