Fossil

Check-in [68a202e101]
Login

Check-in [68a202e101]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Attach login cookies to the root path of the server, so that multiple servers can coexist on the same site.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 68a202e101e733749ce0e6c345e79da455aef96b
User & Date: drh 2007-11-21 12:21:03.000
Context
2007-11-21
13:52
Append the pathname to the login cookie name so that separate cookies are used for each server. ... (check-in: d2b4469934 user: drh tags: trunk)
12:21
Attach login cookies to the root path of the server, so that multiple servers can coexist on the same site. ... (check-in: 68a202e101 user: drh tags: trunk)
03:19
Try again to get the Login/Logout menu name correct. ... (check-in: f0a9e3b523 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/cgi.c.
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
*/
void cgi_set_cookie(
  const char *zName,    /* Name of the cookie */
  const char *zValue,   /* Value of the cookie.  Automatically escaped */
  const char *zPath,    /* Path cookie applies to.  NULL means "/" */
  int lifetime          /* Expiration of the cookie in seconds from now */
){
  if( zPath==0 ) zPath = "/";
  if( lifetime>0 ){
    lifetime += (int)time(0);
    blob_appendf(&extraHeader,
       "Set-Cookie: %s=%t; Path=%s; expires=%s; Version=1\r\n",
        zName, zValue, zPath, cgi_rfc822_datestamp(lifetime));
  }else{
    blob_appendf(&extraHeader,







|







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
*/
void cgi_set_cookie(
  const char *zName,    /* Name of the cookie */
  const char *zValue,   /* Value of the cookie.  Automatically escaped */
  const char *zPath,    /* Path cookie applies to.  NULL means "/" */
  int lifetime          /* Expiration of the cookie in seconds from now */
){
  if( zPath==0 ) zPath = g.zTop;
  if( lifetime>0 ){
    lifetime += (int)time(0);
    blob_appendf(&extraHeader,
       "Set-Cookie: %s=%t; Path=%s; expires=%s; Version=1\r\n",
        zName, zValue, zPath, cgi_rfc822_datestamp(lifetime));
  }else{
    blob_appendf(&extraHeader,
Changes to src/style.c.
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
}

/*
** Draw the header.
*/
void style_header(const char *zTitle){
  const char *zLogInOut = "Login";
  const char *zHeader = db_get("header", zDefaultHeader);  
  struct Subscript *p;
  login_check_credentials();

  /* Generate the header up through the main menu */
  p = SbS_Create();
  SbS_Store(p, "title", zTitle, 0);
  SbS_Store(p, "baseurl", g.zBaseURL, 0);







|







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
}

/*
** Draw the header.
*/
void style_header(const char *zTitle){
  const char *zLogInOut = "Login";
  const char *zHeader = db_get("header", (char*)zDefaultHeader);  
  struct Subscript *p;
  login_check_credentials();

  /* Generate the header up through the main menu */
  p = SbS_Create();
  SbS_Store(p, "title", zTitle, 0);
  SbS_Store(p, "baseurl", g.zBaseURL, 0);