You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Securing the cookie

In this section we will explain how to secure the cookie depending on the Blueriq Runtime you are using. (Java or .NET version)

Java Runtime

In the Java Runtime the way of securing the cookie differs between R10 and R9 or older versions.

For R9 or older versions, the value (true | false) is specified in the deployment descriptor (web.xml):

<web-app ...>
	<session-config>
		<secure>true</secure>
	</session-config>
</web-app>

For R10-R14 you can set the environment variable BLUERIQ_SECURE_SESSION_COOKIE to true.

BLUERIQ_SECURE_SESSION_COOKIE=true

For R14.7 and newer, you can set a property.

application.properties
blueriq.session.cookie.secure=true

.NET Runtime

In the .NET Runtime there is no difference in in the way of securing the cookie between R10 and R9 or older versions. 

The value is specified in Web.config under <system.web> tag:

<system.web>
 <httpCookies requireSSL="true" />
</system.web>

The Blueriq cookie is not secured by default. Securing the cookie should take place on the same location where the SSL offloading is done. The reason behind this, is because it is not possible to send a cookie with the secure flag set over an unencrypted HTTP request. For example, if the SSL offloading is done by the loadbalancer, here the secure flag should be enabled and disabled.

The only use case to enable the secure flag as specified above is when offloading takes place on the application server where the Runtime is deployed (Tomcat, JBoss, Websphere).


Timeout

In this section we will explain how to set the session timeout depending on the Blueriq Runtime you are using. (Java or .NET version)

Java Runtime

In the Java Runtime the way of defining the session timeout differs between R10 and R9 or older versions.

For R9 or older versions, the value in minutes of the timeout is specified in the deployment descriptor (web.xml):

<web-app ...>
	<session-config>
		<session-timeout>20</session-timeout>
	</session-config>
</web-app>

For R10 we benefit of various Spring Boot common properties that can be specified inside application.properties or it can be given as a VM argument.

server.session.timeout=1200 # Session timeout in seconds.

In R11 Spring renamed this property to:

server.servlet.session.timeout=1200 # Session timeout in seconds.

If you are upgrading from R9 to R10 pay attention to the session timeout measurement unit. If in R9 or older versions, the value is specified in minutes, in R10 the value is specified in seconds.


.NET Runtime

In the .NET Runtime there is no difference in in the way of specifying the session timeout between R10 and R9 or older versions. 

The value in minutes is specified in Web.config under <system.web> tag:

<system.web>
 <sessionState timeout="20" />
</system.web>
  • No labels