[Libwebsockets] RFC: lightweight sessions

Colin Adams colinpauladams at gmail.com
Wed May 25 14:52:37 CEST 2016


Cookie copy failed.

Incidentally, I had to change that from lwsl_info to lwsl_err to see the
message. I'm running with -d 255 - I had assumed that would be sufficient
bits to display all messages, but no. What do i need to specify to see info
messages?

On Wed, 25 May 2016 at 13:48 Andy Green <andy at warmcat.com> wrote:

>
>
> On May 25, 2016 8:45:30 PM GMT+08:00, Colin Adams <
> colinpauladams at gmail.com> wrote:
> >That routine isn't being called in my scenario.
>
> What happens in lwsgs_get_sid_from_wsi() then, which is the caller of
> lwsgw_session_from_cookie()?  Or it doesn't get there either?
>
> -Andy
>
> >On Wed, 25 May 2016 at 13:39 Colin Adams <colinpauladams at gmail.com>
> >wrote:
> >
> >> I'm afraid not.
> >> I'll try adding some debugging statements to that routine, to see if
> >I can
> >> find out what's wrong.
> >>
> >> On Wed, 25 May 2016 at 13:27 Andy Green <andy at warmcat.com> wrote:
> >>
> >>>
> >>>
> >>> On 05/25/2016 07:55 PM, Colin Adams wrote:
> >>> > Good, because installing the chrome extension isn't making a
> >difference.
> >>> > Maybe it's just Google proaganda, or maybe there is something else
> >I
> >>> > need to do other than restart chrome (but I can't find out what).
> >>>
> >>> I dunno why you have become contaminated with google cookie pieces
> >on
> >>> localhost.
> >>>
> >>> We do take some care to find out bit of the cookie string already.
> >>>
> >>> static int
> >>> lwsgw_session_from_cookie(const char *cookie, lwsgw_hash *sid)
> >>> {
> >>>         const char *p = cookie;
> >>>         int n;
> >>>
> >>>         while (*p) {
> >>>                 if (p[0] == 'i' && p[1] == 'd' && p[2] == '=') {
> >>>                         p += 3;
> >>>                         break;
> >>>                 }
> >>>                 p++;
> >>>         }
> >>>         if (!*p) {
> >>>                 lwsl_info("no id= in cookie\n");
> >>>                 return 1;
> >>>         }
> >>>
> >>>         for (n = 0; n < sizeof(sid->id) - 1 && *p; n++) {
> >>>                 /* our SID we issue only has these chars */
> >>>                 if ((*p >= '0' && *p <= '9') ||
> >>>                     (*p >= 'a' && *p <= 'f'))
> >>>                         sid->id[n] = *p++;
> >>>                 else {
> >>>                         lwsl_info("bad chars in cookie id %c\n",
> >*p);
> >>>                         return 1;
> >>>                 }
> >>>         }
> >>>
> >>>         if (n < sizeof(sid->id) - 1) {
> >>>                 lwsl_info("cookie id too short\n");
> >>>                 return 1;
> >>>         }
> >>>
> >>>         sid->id[sizeof(sid->id) - 1] = '\0';
> >>>
> >>>         return 0;
> >>> }
> >>>
> >>> and he should be able to get hold if id part from what you have.
> >>>
> >>> The problem is that the cookie you have is waaay larger than what we
> >>> sent and what I thought would be coming back.
> >>>
> >>> I increased the size of the cookie buffer to 1024 on master, please
> >see
> >>> if that helps.
> >>>
> >>> -Andy
> >>>
> >>> >
> >>>
>
> >__utmz=111872281.1460920747.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
> >>> >      >      > id=93e091ce192617282f7d7b50999d043358b470e8
> >>> >      >      >
> >>> >      >      >
> >>> >      >
> >>> >
> >>>
>
> >admin=needadmin%2Fadmin-login.html&good=needauth%2Fsuccessful-login.html&bad=failed-login.html&username=admin&password=<blanked-out>&password2=&email=
> >>> >      >      > 11:24:31.074835 IP (tos 0x0, ttl 64, id 49958,
> >offset 0,
> >>> >     flags [DF],
> >>> >      >      > proto TCP (6), length 52)
> >>> >      >      >      localhost.localdomain.7681 >
> >>> >     localhost.localdomain.49780: Flags
> >>> >      >      > [.], cksum 0xfe28 (incorrect -> 0x5f7c), seq 1, ack
> >913,
> >>> >     win 365,
> >>> >      >      > options [nop,nop,TS val 19154047 ecr 19154047],
> >length 0
> >>> >      >      > E..4.&@. at .y............tv...q......m.(.....
> >>> >      >      > .$D..$D.
> >>> >      >      > 11:24:31.113090 IP (tos 0x0, ttl 64, id 49959,
> >offset 0,
> >>> >     flags [DF],
> >>> >      >      > proto TCP (6), length 295)
> >>> >      >      >      localhost.localdomain.7681 >
> >>> >     localhost.localdomain.49780: Flags
> >>> >      >      > [P.], cksum 0xff1b (incorrect -> 0xade4), seq 1:244,
> >ack
> >>> >     913, win
> >>> >      >     365,
> >>> >      >      > options [nop,nop,TS val 19154085 ecr 19154047],
> >length 243
> >>> >      >      > E..'.'@. at .x............tv...q......m.......
> >>> >      >      > .$D..$D.HTTP/1.1 303 Redirect
> >>> >      >      > server: lwsws
> >>> >      >      > location: needadmin/admin-login.html
> >>> >      >      > content-type: text/html
> >>> >      >      > content-length: 0
> >>> >      >      > set-cookie:
> >>> >      >      >
> >>> >     id=030cca376bc2b6b56f4545c3e063e0f5d162d107;Expires=2016-05-25
> >12:04
> >>> >      >      > GMT;path=/;Max-Age=1464177871;HttpOnly
> >>> >      >      >
> >>> >      >      >
> >>> >      >      > 11:24:31.113108 IP (tos 0x0, ttl 64, id 54110,
> >offset 0,
> >>> >     flags [DF],
> >>> >      >      > proto TCP (6), length 52)
> >>> >      >      >      localhost.localdomain.49780 >
> >>> >     localhost.localdomain.7681: Flags
> >>> >      >      > [.], cksum 0xfe28 (incorrect -> 0x5dfa), seq 913,
> >ack 244,
> >>> >     win 432,
> >>> >      >      > options [nop,nop,TS val 19154085 ecr 19154085],
> >length 0
> >>> >      >      > E..4.^@. at .ic.........t..q...v........(.....
> >>> >      >      > .$D..$D.
> >>> >      >      > 11:24:31.114526 IP (tos 0x0, ttl 64, id 54111,
> >offset 0,
> >>> >     flags [DF],
> >>> >      >      > proto TCP (6), length 739)
> >>> >      >      >      localhost.localdomain.49780 >
> >>> >     localhost.localdomain.7681: Flags
> >>> >      >      > [P.], cksum 0x00d8 (incorrect -> 0x2a01), seq
> >913:1600,
> >>> >     ack 244, win
> >>> >      >      > 432, options [nop,nop,TS val 19154087 ecr 19154085],
> >>> >     length 687
> >>> >      >      > E...._ at .@.f..........t..q...v..............
> >>> >      >      > .$D..$D.GET /lwsgs/needadmin/admin-login.html
> >HTTP/1.1
> >>> >      >      > Host: localhost:7681
> >>> >      >      > Connection: keep-alive
> >>> >      >      > Cache-Control: max-age=0
> >>> >      >      > Accept:
> >>> >      >      >
> >>> >      >
> >>> >
> >>>
> >text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
> >>> >      >      > Upgrade-Insecure-Requests: 1
> >>> >      >      > User-Agent: Mozilla/5.0 (X11; Linux x86_64)
> >>> AppleWebKit/537.36
> >>> >      >     (KHTML,
> >>> >      >      > like Gecko) Chrome/50.0.2661.102 Safari/537.36
> >>> >      >      > Referer: http://localhost:7681/lwsgs/
> >>> >      >      > Accept-Encoding: gzip, deflate, sdch
> >>> >      >      > Accept-Language: en,en-US;q=0.8,ja;q=0.6
> >>> >      >      > Cookie:
> >>> >      >
> >>>  __utma=111872281.642915585.1460920747.1460920747.1460920747.1;
> >>> >      >      > __utmc=111872281;
> >>> >      >      >
> >>> >      >
> >>> >
> >>>
>
> >__utmz=111872281.1460920747.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
> >>> >      >      > id=030cca376bc2b6b56f4545c3e063e0f5d162d107
> >>> >      >
> >>> >      >     Ehhh that's the problem, there is a ton of other weird
> >>> >     unrelated cookie
> >>> >      >     stuff coming on your setup.
> >>> >      >
> >>> >      >     Do you recognize what this __utmc and such is about?
> >>> >      >
> >>> >      >     -Andy
> >>> >      >
> >>> >      >      > 11:24:31.114612 IP (tos 0x0, ttl 64, id 49960,
> >offset 0,
> >>> >     flags [DF],
> >>> >      >      > proto TCP (6), length 141)
> >>> >      >      >      localhost.localdomain.7681 >
> >>> >     localhost.localdomain.49780: Flags
> >>> >      >      > [P.], cksum 0xfe81 (incorrect -> 0xeb96), seq
> >244:333, ack
> >>> >     1600, win
> >>> >      >      > 380, options [nop,nop,TS val 19154087 ecr 19154087],
> >>> length 89
> >>> >      >      > E....(@. at .y@...........tv...q......|.......
> >>> >      >      > .$D..$D.HTTP/1.1 401 Unauthorized
> >>> >      >      > server: lwsws
> >>> >      >      > content-type: text/html
> >>> >      >      > content-length: 38
> >>> >      >      >
> >>> >      >      >
> >>> >      >      > On Wed, 25 May 2016 at 08:20 Andy Green
> ><andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >      > <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>> wrote:
> >>> >      >      >
> >>> >      >      >
> >>> >      >      >
> >>> >      >      >     On 05/25/2016 02:46 PM, Colin Adams wrote:
> >>> >      >      >      > It's not helping, even after clearing the
> >cookie.
> >>> >      >      >      > Log says:
> >>> >      >      >      >
> >>> >      >      >      > <snip>
> >>> >      >      >      > lwsws[7509]: failed to get sid from wsi
> >>> >      >      >      > lwsws[7509]: LWS_CALLBACK_HTTP
> >>> >      >      >      > lwsws[7509]: LWS_CALLBACK_HTTP_BODY:
> >/lwsgs/login
> >>> >      >      >      > lwsws[7509]: Creating new session:
> >>> >      >      >     ba99558f0392beff7e8df23ceb83bc1492e3c6d5
> >>> >      >      >      > lwsws[7509]: setting cookie
> >>> >      >      >      >
> >>> >      >
> >>> >
> >'id=ba99558f0392beff7e8df23ceb83bc1492e3c6d5;Expires=2016-05-25
> >>> 08:25
> >>> >      >      >      > GMT;path=/;Max-Age=1464164700;HttpOnly'
> >>> >      >      >      > lwsws[7509]: failed to get sid from wsi
> >>> >      >      >      > lwsws[7509]: Access rights fail 0x3 vs 0x0
> >(cookie
> >>> )
> >>> >      >      >
> >>> >      >      >     I also checked it in Firefox as well as Chrome,
> >here
> >>> it's
> >>> >      >     fine.  Are you
> >>> >      >      >     using a different browser?
> >>> >      >      >
> >>> >      >      >       From scratch, going to
> >>> >      >      >
> >>> >      >      > http://localhost:7681/lwsgs
> >>> >      >      >
> >>> >      >      >     and then typing
> >>> >      >      >
> >>> >      >      >     admin
> >>> >      >      >     jipdocesExunt
> >>> >      >      >
> >>> >      >      >     and hit the login button should give this
> >>> >      >      >
> >>> >      >      >     lwsws[19232]: want
> >>> >      >      >
> >>> >
> >/usr/share/libwebsockets-test-server/generic-sessions//lwsgs.js
> >>> >      >      >     interpreted by protocol-generic-sessions
> >>> >      >      >     lwsws[19232]: LWS_CALLBACK_HTTP
> >>> >      >      >     lwsws[19232]: LWS_CALLBACK_HTTP_BODY:
> >/lwsgs/login
> >>> >      >      >     lwsws[19232]: Authorizing current session
> >>> >      >      >     c4be742bf3d505576575a4bc93d9184cae7017f9
> ><<<====
> >>> >      >      >     lwsws[19232]: setting cookie
> >>> >      >      >
> >>> >      >
> >>> >
> >'id=c4be742bf3d505576575a4bc93d9184cae7017f9;Expires=2016-05-25
> >>> 17:15
> >>> >      >      >     GMT;path=/;Max-Age=36000;HttpOnly'
> >>> >      >      >
> >>> >      >      >     At the end, he's showing the content for
> >>> >      >      >
> >>> >      >      >
> >http://localhost:7681/lwsgs/needadmin/admin-login.html
> >>> >      >      >
> >>> >      >      >     in the browser.
> >>> >      >      >
> >>> >      >      >     But in your case the cookie never seems to come
> >back
> >>> >     from the
> >>> >      >     browser.
> >>> >      >      >     Can you check it sends it (eg, with tcpdump)?
> >>> >      >      >
> >>> >      >      >     -Andy
> >>> >      >      >
> >>> >      >      >      >
> >>> >      >      >      > On Wed, 25 May 2016 at 07:30 Andy Green
> >>> >     <andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >      > <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>> wrote:
> >>> >      >      >      >
> >>> >      >      >      >
> >>> >      >      >      >
> >>> >      >      >      >     On 05/25/2016 01:46 PM, Colin Adams
> >wrote:
> >>> >      >      >      >      > I had to delete my directory, and
> >checkout
> >>> >     afresh
> >>> >      >     (git log
> >>> >      >      >     showed the
> >>> >      >      >      >      > history was all askew). Now it's
> >working
> >>> >     much better. I
> >>> >      >      >     get a 401
> >>> >      >      >      >
> >>> >      >      >      >     Yes git pull can't deal with the history
> >>> >     rewriting, if you
> >>> >      >      >     use git fetch
> >>> >      >      >      >     you'll be fine.
> >>> >      >      >      >
> >>> >      >      >      >      > unauthorized response when attempting
> >to
> >>> >     login as admin
> >>> >      >      >     though - same
> >>> >      >      >      >      > for both the original shipped
> >>> password/sha1, and
> >>> >      >     when I try
> >>> >      >      >      >     creating a
> >>> >      >      >      >      > sha1 for my own choice of password. Is
> >this
> >>> >     to be
> >>> >      >     expected at
> >>> >      >      >      >     this stage
> >>> >      >      >      >      > of the development?
> >>> >      >      >      >
> >>> >      >      >      >     No, the last push worked well for login
> >and
> >>> >     logout as
> >>> >      >     admin.
> >>> >      >      >      >
> >>> >      >      >      >     However most of the problems you found
> >existed
> >>> >     here, but
> >>> >      >      >     didn't disrupt
> >>> >      >      >      >     it working here by bad luck, it's been
> >>> continuously
> >>> >      >     working
> >>> >      >      >     since I
> >>> >      >      >      >     first pushed it and still works.
> >>> >      >      >      >
> >>> >      >      >      >
> >>> >      >      >      >     Today I added javascript around the
> >>> >     login/registration
> >>> >      >     page
> >>> >      >      >     to validate
> >>> >      >      >      >     stuff, check the two pw are the same,
> >disable
> >>> >     buttons
> >>> >      >     until
> >>> >      >      >     enough
> >>> >      >      >      >     things are filled in, etc.
> >>> >      >      >      >
> >>> >      >      >      >     The registration code is also done, the
> >user db
> >>> >     gets
> >>> >      >     filled
> >>> >      >      >     in, pw
> >>> >      >      >      >     salted hash and salt is stored in there.
> >>> >      >      >      >
> >>> >      >      >      >     Atm it associates the cookie with the new
> >>> >     account after
> >>> >      >      >     registration,
> >>> >      >      >      >     but log back in won't work since the code
> >isn't
> >>> >     there yet.
> >>> >      >      >      >
> >>> >      >      >      >     Please pull master again, you will need
> >to nuke
> >>> >     the db
> >>> >      >     since
> >>> >      >      >     the schema
> >>> >      >      >      >     changed
> >>> >      >      >      >
> >>> >      >      >      >     sudo rm -rf /var/www/sessions/lws.sqlite3
> >>> >      >      >      >
> >>> >      >      >      >     Btw you can dump the db readably like
> >this
> >>> >      >      >      >
> >>> >      >      >      >        echo .dump | sudo sqlite3
> >>> >     /var/www/sessions/lws.sqlite3
> >>> >      >      >      >
> >>> >      >      >      >
> >>> >      >      >      >     If still 401, clear your cookie in your
> >browser
> >>> >     and retry.
> >>> >      >      >      >
> >>> >      >      >      >     -Andy
> >>> >      >      >      >
> >>> >      >      >      >
> >>> >      >      >      >      > On Wed, 25 May 2016 at 01:21 Andy
> >Green
> >>> >      >     <andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >      >     <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com> <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>
> >>> >      >      >      >      > <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com> <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>>> wrote:
> >>> >      >      >      >      >
> >>> >      >      >      >      >
> >>> >      >      >      >      >
> >>> >      >      >      >      >     On 05/25/2016 02:09 AM, Colin
> >Adams
> >>> wrote:
> >>> >      >      >      >      >      > It doesn't seem to make much
> >>> difference.
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      > Js console shows:
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      > GET
> >>> http://localhost:7681/lwsgs/lwsgs.js
> >>> >      >      >      >      >      >
> >net::ERR_INCOMPLETE_CHUNKED_ENCODING
> >>> >      >      >      >      >
> >>> >      >      >      >      >     It's fixed on master.
> >>> >      >      >      >      >
> >>> >      >      >      >      >      > (index):32 Uncaught
> >ReferenceError:
> >>> >      >     lwsgs_user is not
> >>> >      >      >      >      >     defined(anonymous
> >>> >      >      >      >      >      > function) @ (index):32
> >>> >      >      >      >      >      > (index):99 Uncaught
> >ReferenceError:
> >>> >     san is not
> >>> >      >      >      >     defined(anonymous
> >>> >      >      >      >      >      > function) @ (index):99
> >>> >      >      >      >      >      > (index):113 Uncaught
> >ReferenceError:
> >>> >      >     lwsgs_user is not
> >>> >      >      >      >      >     defined(anonymous
> >>> >      >      >      >      >      > function) @ (index):113
> >>> >      >      >      >      >
> >>> >      >      >      >      >     Yes the common JS that gets
> >rewritten
> >>> didn't
> >>> >      >     arrive,
> >>> >      >      >     it's why
> >>> >      >      >      >     no script
> >>> >      >      >      >      >     ran to select a div.  All of that
> >should
> >>> >      >     disappear with
> >>> >      >      >      >     current master.
> >>> >      >      >      >      >
> >>> >      >      >      >      >      > Log shows:
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      > lwsws[13480]: Set privs to user
> >>> 'apache'
> >>> >      >      >      >      >      > lwsws[13480]: failed to get sid
> >from
> >>> wsi
> >>> >      >      >      >      >      > lwsws[13480]:
> >>> LWS_CALLBACK_ADD_HEADERS:
> >>> >      >     setting cookie
> >>> >      >      >      >      >      >
> >>> >      >      >      >
> >>> >      >      >
> >>> >      >
> >>> >
> >'id=df5a721afc83cb6d849282b3fe6fd43d75073213;Expires=2016-05-24
> >>> 18:27
> >>> >      >      >      >      >      >
> >>> GMT;path=/;Max-Age=1464114478;HttpOnly'
> >>> >      >      >      >      >      > lwsws[13480]: failed to get sid
> >from
> >>> wsi
> >>> >      >      >      >      >      > lwsws[13480]: want
> >>> >      >      >      >      >      >
> >>> >      >      >      >
> >>> >      >      >
> >>> >      >
> >>> >
> >>>
> >/usr/local/share/libwebsockets-test-server/generic-sessions//lwsgs.js
> >>> >      >      >      >      >      > interpreted by
> >>> protocol-generic-sessions
> >>> >      >      >      >      >      > lwsws[13480]:
> >>> LWS_CALLBACK_ADD_HEADERS:
> >>> >      >     setting cookie
> >>> >      >      >      >      >      >
> >>> >      >      >      >
> >>> >      >      >
> >>> >      >
> >>> >
> >'id=9204b4cdb481b9f84ebfa4f686e441bb1065c5bb;Expires=2016-05-24
> >>> 18:27
> >>> >      >      >      >      >      >
> >>> GMT;path=/;Max-Age=1464114479;HttpOnly'
> >>> >      >      >      >      >      > lwsws[13480]: Used up interpret
> >>> padding
> >>> >      >      >      >      >      > lwsws[13480]: LWS_CALLBACK_HTTP
> >>> >      >      >      >      >      > lwsws[13480]: failed to get sid
> >from
> >>> wsi
> >>> >      >      >      >      >      > lwsws[13480]:
> >>> LWS_CALLBACK_ADD_HEADERS:
> >>> >      >     setting cookie
> >>> >      >      >      >      >      >
> >>> >      >      >      >
> >>> >      >      >
> >>> >      >
> >>> >
> >'id=340c5b33faf9ca957048845f13e7cfe37a56991e;Expires=2016-05-24
> >>> 18:27
> >>> >      >      >      >      >      >
> >>> GMT;path=/;Max-Age=1464114479;HttpOnly'
> >>> >      >      >      >      >      > lwsws[13480]: wsi 0x1c8b8b0:
> >TIMEDOUT
> >>> >      >     WAITING on 10
> >>> >      >      >     (did
> >>> >      >      >      >     hdr 1, ah
> >>> >      >      >      >      >      > 0x1c40048, wl 0, pfd events 0)
> >>> >      >      >      >      >      > lwsws[13480]:
> >>> >     lws_header_table_detach: wsi
> >>> >      >      >     0x1c8b8b0: ah
> >>> >      >      >      >     held 21s,
> >>> >      >      >      >      >      > ah.rxpos 568, ah.rxlen 568,
> >>> mode/state 2
> >>> >      >      >      >     4,wsi->more_rx_waiting 0
> >>> >      >      >      >      >
> >>> >      >      >      >      >     I also added support for expired
> >client
> >>> >     cookie
> >>> >      >     since
> >>> >      >      >     you'll
> >>> >      >      >      >     hit that
> >>> >      >      >      >      >     next, it does a redirect to itself
> >and
> >>> >     paints
> >>> >      >     you with
> >>> >      >      >     a new
> >>> >      >      >      >     cookie.
> >>> >      >      >      >      >
> >>> >      >      >      >      >     -Andy
> >>> >      >      >      >      >
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      > On Tue, 24 May 2016 at 18:39
> >Andy
> >>> Green
> >>> >      >      >     <andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >      >     <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com> <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>
> >>> >      >      >      >      >     <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>>
> >>> >      >      >      >      >      > <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>
> >>> >      >      >      >     <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com> <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>>>>
> >wrote:
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      >     On 05/25/2016 01:32 AM,
> >Andy
> >>> >     Green wrote:
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      > On May 25, 2016 1:23:50
> >AM
> >>> >     GMT+08:00,
> >>> >      >     Colin
> >>> >      >      >     Adams
> >>> >      >      >      >      >      >     <colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>
> >>> >      >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>>
> >>> >     <mailto:colinpauladams at gmail.com
> ><mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>
> >>> >      >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>>>
> >>> >      >      >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>
> >>> >      >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>>
> >>> >     <mailto:colinpauladams at gmail.com
> ><mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>
> >>> >      >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>
> >>> >      >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>
> >>> >      >     <mailto:colinpauladams at gmail.com
> >>> >     <mailto:colinpauladams at gmail.com>>>>>>>
> >>> >      >      >      >      >     wrote:
> >>> >      >      >      >      >      >      >> I'm still seeing a
> >blank page
> >>> >     (from
> >>> >      >      >     display:none
> >>> >      >      >      >     on the
> >>> >      >      >      >      >     divs).
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      > Check your browser js
> >>> >     console... when you
> >>> >      >      >     first saw
> >>> >      >      >      >     this
> >>> >      >      >      >      >     it was
> >>> >      >      >      >      >      >     because the browser looked
> >for
> >>> >     /lwsgs.js
> >>> >      >     when it
> >>> >      >      >      >     should have
> >>> >      >      >      >      >     looked
> >>> >      >      >      >      >      >     at /lwsgs/lwsgs.js, and got
> >a
> >>> 404.
> >>> >      >     After that
> >>> >      >      >     it won't be
> >>> >      >      >      >      >     able to
> >>> >      >      >      >      >      >     process the scripts.
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      > That should be solved by
> >the /
> >>> >     at the
> >>> >      >     end of
> >>> >      >      >     the url.
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      > For reference if I clear
> >the
> >>> >     cookie
> >>> >      >     by hand
> >>> >      >      >     at the
> >>> >      >      >      >     browser and
> >>> >      >      >      >      >      >     then go to
> >>> >     http://localhost:7681/lwsgs
> >>> >      >     the log is
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      > lwsws[12811]: failed to
> >get
> >>> >     sid from wsi
> >>> >      >      >      >      >      >      > lwsws[12811]: failed to
> >get
> >>> >     sid from wsi
> >>> >      >      >      >      >      >      > lwsws[12811]:
> >>> >     LWS_CALLBACK_ADD_HEADERS:
> >>> >      >      >     setting cookie
> >>> >      >      >      >      >      >
> >>> >      >      >      >
> >>> >      >
> >>>  'id=8c0325ae054f18f5eaf8428de75c77d5c9038aee;Expires=2016-05-24
> >>> >      >      >      >      >      >     17:45
> >>> >      >     GMT;path=/;Max-Age=1464111957;HttpOnly'
> >>> >      >      >      >      >      >      > lwsws[12811]: want
> >>> >      >      >      >      >      >
> >>> >      >      >      >
> >>> >      >
> >>>  /usr/share/libwebsockets-test-server/generic-sessions//lwsgs.js
> >>> >      >      >      >      >      >     interpreted by
> >>> >     protocol-generic-sessions
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      > and I have the login
> >page up
> >>> >     (which can
> >>> >      >      >     login using the
> >>> >      >      >      >      >     default
> >>> >      >      >      >      >      >     admin credentials).
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      >     Sorry one more update on
> >master
> >>> that
> >>> >      >     might be
> >>> >      >      >     related.
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      >     -Andy
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >      >      > -Andy
> >>> >      >      >      >      >      >      >
> >>> >      >      >      >      >      >      >> The log looks
> >innocuous:
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >      >      >> wsws[12023]: Set privs
> >to
> >>> >     user 'apache'
> >>> >      >      >      >      >      >      >> lwsws[12023]: failed to
> >get
> >>> >     sid from wsi
> >>> >      >      >      >      >      >      >> lwsws[12023]:
> >>> >     LWS_CALLBACK_ADD_HEADERS:
> >>> >      >      >     setting cookie
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >
> >>> >      >      >
> >>> >
> >'id=da8e98cc0e4b771f77e042121183a3b8f2b0b86d;Expires=2016-05-24
> >>> >      >      >      >      >      >     17:41
> >>> >      >      >      >      >      >      >>
> >>> >     GMT;path=/;Max-Age=1464111699;HttpOnly'
> >>> >      >      >      >      >      >      >> lwsws[12023]: failed to
> >get
> >>> >     sid from wsi
> >>> >      >      >      >      >      >      >> lwsws[12023]: failed to
> >get
> >>> >     sid from wsi
> >>> >      >      >      >      >      >      >> lwsws[12023]:
> >>> >     LWS_CALLBACK_ADD_HEADERS:
> >>> >      >      >     setting cookie
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >
> >>> >      >      >
> >>> >
> >'id=c7762dcda3c39bd0f1c3628b77cf50d61b22bca9;Expires=2016-05-24
> >>> >      >      >      >      >      >     17:41
> >>> >      >      >      >      >      >      >>
> >>> >     GMT;path=/;Max-Age=1464111704;HttpOnly'
> >>> >      >      >      >      >      >      >> lwsws[12023]: failed to
> >get
> >>> >     sid from wsi
> >>> >      >      >      >      >      >      >> lwsws[12023]:
> >>> >     LWS_CALLBACK_ADD_HEADERS:
> >>> >      >      >     setting cookie
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >
> >>> >      >      >
> >>> >
> >'id=2d3a680609d72519c539c7f1822fdf40a7ffd1e3;Expires=2016-05-24
> >>> >      >      >      >      >      >     17:43
> >>> >      >      >      >      >      >      >>
> >>> >     GMT;path=/;Max-Age=1464111783;HttpOnly'
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >      >      >> On Tue, 24 May 2016 at
> >18:12
> >>> >     Andy Green
> >>> >      >      >      >     <andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>
> >>> >      >      >      >      >     <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>>
> >>> >      >      >      >      >      >     <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>
> >>> >      >      >      >     <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com> <mailto:andy at warmcat.com
> >>> >     <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>
> >>> >      >      >     <mailto:andy at warmcat.com
> ><mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>
> >>> >      >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>
> >>> >     <mailto:andy at warmcat.com <mailto:andy at warmcat.com>>>>>>>
> >wrote:
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >      >      >>>
> >>> >      >      >      >      >      >      >>>
> >>> >      >      >      >      >      >      >>> On 05/25/2016 01:04
> >AM,
> >>> >     Colin Adams
> >>> >      >     wrote:
> >>> >      >      >      >      >      >      >>>> It's the same result,
> >>> >     although it
> >>> >      >     takes
> >>> >      >      >     longer,
> >>> >      >      >      >     and the log
> >>> >      >      >      >      >      >     entries
> >>> >      >      >      >      >      >      >> are
> >>> >      >      >      >      >      >      >>>> different:
> >>> >      >      >      >      >      >      >>>>
> >>> >      >      >      >      >      >      >>>> wsws[11461]: Set
> >privs to
> >>> user
> >>> >      >     'apache'
> >>> >      >      >      >      >      >      >>>> lwsws[11461]: failed
> >to
> >>> get sid
> >>> >      >     from wsi
> >>> >      >      >      >      >      >      >>>> lwsws[11461]:
> >>> >      >     LWS_CALLBACK_ADD_HEADERS:
> >>> >      >      >     setting
> >>> >      >      >      >     cookie
> >>> >      >      >      >      >      >      >>>>
> >>> >      >      >      >      >
> >>> >      >      >
> >>> >
> >'id=3f1d8b0159ffe2c1f1abaf74a2cbbee84f229391;Expires=2016-05-24
> >>> >      >      >      >      >      >      >> 17:23
> >>> >      >      >      >      >      >      >>>>
> >>> >      >     GMT;path=/;Max-Age=1464110613;HttpOnly'
> >>> >      >      >      >      >      >      >>>> lwsws[11461]: failed
> >to
> >>> get sid
> >>> >      >     from wsi
> >>> >      >      >      >      >      >      >>>> lwsws[11461]: want
> >>> >      >      >      >      >      >      >>>>
> >>> >      >      >      >      >      >      >>
> >>> >      >      >      >      >      >
> >>> >      >      >      >      >
> >>> >      >      >      >
> >>> >      >      >
> >>> >      >
> >>> >
> >>>
> >/usr/local/share/libwebsockets-test-server/generic-sessions//lwsgs.js
> >>> >      >      >      >      >      >      >>>> interpreted by
> >>> >      >     protocol-generic-sessions
> >>> >      >      >      >      >      >      >>>> lwsws[11461]:
> >>> >      >     LWS_CALLBACK_ADD_HEADERS:
> >>> >      >      >     setting
> >>> >      >      >      >     cookie
> >>> >      >      >      >      >      >      >>>>
> >>> >      >      >      >      >
> >>> >      >      >
> >>> >
> >'id=abc1299229ef19850166323b1dcd055ecf155d7a;Expires=2016-05-24
> >>> >      >      >      >      >      >      >> 17:23
> >>> >      >      >      >      >      >      >>>>
> >>> >      >     GMT;path=/;Max-Age=1464110613;HttpOnly'
> >>> >      >      >      >      >      >      >>>> lwsws[11461]: Used up
> >>> interpret
> >>> >      >     padding
> >>> >      >      >      >      >      >      >>>> lwsws[11461]:
> >>> LWS_CALLBACK_HTTP
> >>> >      >      >      >      >      >      >>>> lwsws[11461]: failed
> >to
> >>> get sid
> >>> >      >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20160525/8e2a353c/attachment-0001.html>


More information about the Libwebsockets mailing list