char *c = workspace;
char *retval = NULL;
struct ast_variable *v;
- unsigned int new_session = 0;
for (v = params; v; v = v->next) {
if (!strcasecmp(v->name, "mansession_id")) {
ast_atomic_fetchadd_int(&s->eventq->usecount, 1);
ast_atomic_fetchadd_int(&num_sessions, 1);
AST_LIST_UNLOCK(&sessions);
- new_session = 1;
}
/* Reset HTTP timeout. If we're not yet authenticated, keep it extremely short */
s->needdestroy = 1;
}
ast_build_string(&c, &len, "Content-type: text/%s\r\n", contenttype[format]);
- if (new_session) {
- sprintf(tmp, "%08lx", s->managerid);
- ast_build_string(&c, &len, "%s\r\n", ast_http_setcookie("mansession_id", tmp, httptimeout, cookie, sizeof(cookie)));
- }
+ sprintf(tmp, "%08lx", s->managerid);
+ ast_build_string(&c, &len, "%s", ast_http_setcookie("mansession_id", tmp, httptimeout, cookie, sizeof(cookie)));
if (format == FORMAT_HTML)
ast_build_string(&c, &len, "<title>Asterisk™ Manager Interface</title>");
if (format == FORMAT_XML) {