ninja icon indicating copy to clipboard operation
ninja copied to clipboard

Log warning if trying to use session cookie with http

Open jjlauer opened this issue 9 years ago • 1 comments

If you're trying to use a session cookie and your 1) using http, 2) in dev mode and 3) haven't changed the application config application.session.transferred_over_https_only to false then you may simply not know why your sessions are not working.

I propose we do 1 of 2 things:

  1. Log a warning to the console. Nothing like a session not working and you have NO idea why.

  2. application.session.transferred_over_https_only is false by default only in dev & test modes.

jjlauer avatar Dec 27 '16 19:12 jjlauer

got bitten by this too! solved it by adding this to the POM

...
<build>
  <plugins>
    ...
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>3.0.0-M4</version>
      <configuration>
        <argLine>-Dapplication.session.transferred_over_https_only=false</argLine>
      </configuration>
    </plugin>
    ...
  </plugins>
</build>

as well as adding (in Eclipse)

-Dapplication.session.transferred_over_https_only=false

to the [VM arguments] in the [Arguments] panel of every Run Configuration i use for individual test classes when [Run As > JUnit Test].

raif-s-naffah avatar Mar 02 '20 07:03 raif-s-naffah