mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
httpd: give the session cookie a Max-Age matching the timeout
The session cookie carried neither Expires nor Max-Age, so browsers that clean up session cookies aggressively (LibreWolf, for one) may drop it while the session is still valid. Send Max-Age=session_timeout so the declared lifetime matches the timeout already enforced by the firmware. itoa16_html() only converted four digits, so extend it to five to print timeouts up to 65535. That also fixes information.json, which used the same helper and reported wrong values from 10000 s up.
This commit is contained in:
1 parent
6be1871bb4
commit
cdc84c75e4
3 files changed
+8
-2
No files matched your search
+4
-2
@@ -100,12 +100,14 @@ void itoa_html(uint8_t v)
|
||||
char_to_html('0' + (v % 10));
|
||||
}
|
||||
|
||||
void itoa16_html(uint16_t v) /* sufficient for VLAN IDs (max 4094) */
|
||||
void itoa16_html(uint16_t v) /* up to five digits (65535) */
|
||||
{
|
||||
uint8_t print_zeros = 0;
|
||||
uint8_t d;
|
||||
d = v / 1000;
|
||||
d = v / 10000;
|
||||
if (d) { char_to_html('0' + d); print_zeros = 1; }
|
||||
d = (v / 1000) % 10;
|
||||
if (d || print_zeros) { char_to_html('0' + d); print_zeros = 1; }
|
||||
d = (v / 100) % 10;
|
||||
if (d || print_zeros) { char_to_html('0' + d); print_zeros = 1; }
|
||||
d = (v / 10) % 10;
|
||||
|
||||
Reference in new issue
Block a user