summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-30 12:57:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:17 -0500
commit43bc09e2aa609d5ffc978aae18c956a24bcb6a20 (patch)
tree4161a972fb2cf56c8b4d3ae316e832b09d3e3f57
parent419598e1d1043eb254e3c0af43c76d798fdb2b3b (diff)
downloadsamba-43bc09e2aa609d5ffc978aae18c956a24bcb6a20.tar.gz
samba-43bc09e2aa609d5ffc978aae18c956a24bcb6a20.tar.bz2
samba-43bc09e2aa609d5ffc978aae18c956a24bcb6a20.zip
r7107: detect when a users session has expired and set request['SESSION_EXPIRED']
(This used to be commit 0c2e42986ca3d10fbd19c91e2ea59af20e4fce30)
-rw-r--r--source4/web_server/http.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/web_server/http.c b/source4/web_server/http.c
index 02eab1f7d0..35da56a75c 100644
--- a/source4/web_server/http.c
+++ b/source4/web_server/http.c
@@ -675,6 +675,7 @@ static void http_setup_session(struct esp_state *esp)
const char *key = NULL;
struct esp_data *edata = talloc_get_type(esp->web->task->private, struct esp_data);
struct session_data *s;
+ BOOL generated_key = False;
/* look for our session key */
if (cookie && (p = strstr(cookie, session_key)) &&
@@ -687,6 +688,7 @@ static void http_setup_session(struct esp_state *esp)
key = esp->web->input.session_key;
} else if (key == NULL) {
key = generate_random_str_list(esp, 16, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ generated_key = True;
}
/* try to find this session in the existing session list */
@@ -706,6 +708,10 @@ static void http_setup_session(struct esp_state *esp)
s->lifetime = lp_parm_int(-1, "web", "sessiontimeout", 300);
DLIST_ADD(edata->sessions, s);
talloc_set_destructor(s, session_destructor);
+ if (!generated_key) {
+ mprSetPropertyValue(&esp->variables[ESP_REQUEST_OBJ],
+ "SESSION_EXPIRED", mprCreateStringVar("True", 0));
+ }
}
http_setCookie(esp->web, session_key, key, s->lifetime, "/", 0);