10 #include <sys/socket.h>
13 #include <netinet/in.h>
26 typedef unsigned char byte; /* Byte type */
29 * Pack all session info into one easy-to-digest cookie. Healthy and delicious!
31 void stuff_to_cookie(char *cookie, int session, char *user, char *pass, char *room)
35 sprintf(buf, "%d|%s|%s|%s|END", session, user, pass, room);
36 CtdlEncodeBase64(cookie, buf, strlen(buf));
41 * Extract all that fun stuff out of the cookie.
43 void cookie_to_stuff(char *cookie, int *session, char *user, char *pass, char *room)
47 CtdlDecodeBase64(buf, cookie, strlen(cookie));
50 *session = extract_int(buf, 0);
52 extract(user, buf, 1);
54 extract(pass, buf, 2);
56 extract(room, buf, 3);