#8123·luci

Expiration dates are absent from the cookies set by luci

Author: liusen373Created Nov 28, 2025Updated Sep 27, 2026

Cookies need to specify expiration time when returned. Relevant attributes are documented in MDN:

Expires=date (Optional) Indicates the maximum lifetime of the cookie as an HTTP-date timestamp. See Date for the required formatting. If unspecified, the cookie becomes a session cookie. A session finishes when the client shuts down, after which the session cookie is removed.

Max-Age=number (Optional) Indicates the number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately. If both Expires and Max-Age are set, Max-Age has precedence.

However, the current code includes neither attribute

	server.login = function(...)
		local challenge = server.challenge(...)
		if challenge then
			http.header("Set-Cookie", 'sysauth=%s; path=%s' %{
				challenge.sid,
				http.getenv("SCRIPT_NAME")
			})
			return challenge.sid
		end
	end

Actual testing with Firefox browser shows that whenever the browser is closed, the next time it is reopened, re-login is required, rendering the sessiontime parameter set in /etc/config/luci completely ineffective.