save cookies at the end of fetch

This commit is contained in:
Pierre Tachoire
2026-04-14 15:56:40 -04:00
parent de3404dfc5
commit cc4bd417d2

View File

@@ -74,8 +74,8 @@ pub fn fetch(app: *App, url: [:0]const u8, opts: FetchOpts) !void {
};
}
if (app.config.cookieJarFile()) |cookie_jar_path| {
defer {
defer {
if (app.config.cookieJarFile()) |cookie_jar_path| {
cookies.saveToFile(&session.cookie_jar, cookie_jar_path) catch |err| {
log.err(.app, "cookie save error", .{ .err = err });
};