Community
Participate
Working Groups
I am trying to use the _cookieFile_ HttpTransport setup introduced in 5.4.0 (https://projects.eclipse.org/projects/technology.jgit/reviews/5.4.0-release-review) I found that my cookie file is not being used and therefore authentication is failing. Upon digging into the code, I found this particular line https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/internal/transport/http/NetscapeCookieFile.java#L239 ``` long expires = Long.parseLong(cookieLineParts[4]); long maxAge = (expires - creationDate.getTime()) / 1000; if (maxAge <= 0) { return null; // skip expired cookies } ``` You can see that it's comparing the expires with `creationDate.getTime()` which returns the number of milliseconds since January 1, 1970, 00:00:00 GMT. According to the CURL documentation that specifies the NetscapeCookie format https://curl.se/docs/http-cookies.html ``` Fields in the file Field number, what type and example data and the meaning of it: - string example.com - the domain name - boolean FALSE - include subdomains - string /foobar/ - path - boolean TRUE - send/receive over HTTPS only - number 1462299217 - expires at - seconds since Jan 1st 1970, or 0 - string person - name of the cookie - string daniel - value of the cookie ``` _expires at_ should be in *seconds*
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/176983
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/176983 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=40d6eda3f16f24db20776d33e586737efeddc725