Index: modules/session/mod_session.c =================================================================== --- modules/session/mod_session.c (revision 1788360) +++ modules/session/mod_session.c (working copy) @@ -353,11 +353,15 @@ char *buffer = NULL; int length = 0; - if (z->expiry) { + + apr_table_do(identity_count, &length, z->entries, NULL); + + /* Do not send cookie with just expiry set without any data */ + if (length > 0 && z->expiry) { char *expiry = apr_psprintf(z->pool, "%" APR_INT64_T_FMT, z->expiry); apr_table_setn(z->entries, SESSION_EXPIRY, expiry); } - apr_table_do(identity_count, &length, z->entries, NULL); + buffer = apr_pcalloc(r->pool, length + 1); apr_table_do(identity_concat, buffer, z->entries, NULL); z->encoded = buffer;