<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Missing 'Secure' flag in 'Set-Cookie' header in HTTP response."]]></title>
		<link>https://community.jforum.net/posts/list/2.page</link>
		<description><![CDATA[Latest messages posted in the topic "Missing 'Secure' flag in 'Set-Cookie' header in HTTP response."]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Missing &#39;Secure&#39; flag in &#39;Set-Cookie&#39; header in HTTP response.</title>
				<description><![CDATA[ Hi,
<br>
<br>
I performed a small PEN test on my installation of JForum and got a warning that the 'Secure' flag is missing (which is true):
<br>
[code]
<br>
Set-Cookie: jforumAutoLogin=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/; HttpOnly; SameSite=Strict
<br>
Set-Cookie: jforumUserId=1; Max-Age=31536000; Expires=Tue, 10 Mar 2026 19:26:29 GMT; Path=/; HttpOnly; SameSite=Strict
<br>
[/code]
<br>
<br>
I tried to force the inclusion of that flag through the 'session-config' in web.xml:
<br>
[code]
<br>
&lt;session-config&gt;
<br>
&lt;session-timeout&gt;10&lt;/session-timeout&gt;
<br>
&lt;cookie-config&gt;
<br>
&lt;http-only&gt;true&lt;/http-only&gt;
<br>
&lt;secure&gt;true&lt;/secure&gt;
<br>
&lt;/cookie-config&gt;
<br>
&lt;/session-config&gt;
<br>
[/code]
<br>
<br>
But for some strange reason it works for all 'Set-Cookie' headers except for jforum* cookies. Very strange.
<br>
Is there any other way to enforce inclusion of the 'Secure' flag through JForum? The headers are immutable in the HttpServletResponse class, so it can't be changed efterwards through a filter or something similar.
<br>
<br>
Thanks.
<br>
<br>
Regards,
<br>
Tommy
<br>
<br>]]></description>
				<guid isPermaLink="true">https://community.jforum.net/posts/preList/297/1282.page</guid>
				<link>https://community.jforum.net/posts/preList/297/1282.page</link>
				<pubDate><![CDATA[Tue, 11 Mar 2025 23:34:55]]> GMT</pubDate>
				<author><![CDATA[ tommy]]></author>
			</item>
			<item>
				<title>Re:Missing &#39;Secure&#39; flag in &#39;Set-Cookie&#39; header in HTTP response.</title>
				<description><![CDATA[ The settings in web.xml are only for the session cookie, not for any other cookies that may get set by the web app (see [tt]ControllerUtils.addCookie[/tt]). The problem with always setting the [tt]secure[/tt] flag is that it won't work for HTTP-only installations (which sometimes exist in non-public installations). So the thing to do is to make that dependent on the base URL. For the next release I'll add this:
<br>
<br>
[code=java]
<br>
cookie.setHttpOnly(true);
<br>
if (SystemGlobals.getValue(ConfigKeys.FORUM_LINK).startsWith("https"))
<br>
cookie.setSecure(true);
<br>
[/code]
<br>
<br>
but unless you want to recompile the source yourself, there is no external configuration you can apply to make this happen.]]></description>
				<guid isPermaLink="true">https://community.jforum.net/posts/preList/297/1283.page</guid>
				<link>https://community.jforum.net/posts/preList/297/1283.page</link>
				<pubDate><![CDATA[Wed, 12 Mar 2025 17:19:42]]> GMT</pubDate>
				<author><![CDATA[ udittmer]]></author>
			</item>
			<item>
				<title>Re:Missing &#39;Secure&#39; flag in &#39;Set-Cookie&#39; header in HTTP response.</title>
				<description><![CDATA[ Perfect!
<br>
Thanks.
<br>
<br>
Regards,
<br>
Tommy]]></description>
				<guid isPermaLink="true">https://community.jforum.net/posts/preList/297/1284.page</guid>
				<link>https://community.jforum.net/posts/preList/297/1284.page</link>
				<pubDate><![CDATA[Wed, 12 Mar 2025 18:19:51]]> GMT</pubDate>
				<author><![CDATA[ tommy]]></author>
			</item>
	</channel>
</rss>