fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin/* Licensed to the Apache Software Foundation (ASF) under one or more
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * contributor license agreements. See the NOTICE file distributed with
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * this work for additional information regarding copyright ownership.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * The ASF licenses this file to You under the Apache License, Version 2.0
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * (the "License"); you may not use this file except in compliance with
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * the License. You may obtain a copy of the License at
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Unless required by applicable law or agreed to in writing, software
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * distributed under the License is distributed on an "AS IS" BASIS,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * See the License for the specific language governing permissions and
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * limitations under the License.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Structure to carry the per-dir session config.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrintypedef struct {
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin/* optional function - look it up once in post_config */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic ap_dbd_t *(*session_dbd_acquire_fn) (request_rec *) = NULL;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic void (*session_dbd_prepare_fn) (server_rec *, const char *, const char *) = NULL;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Initialise the database.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * If the mod_dbd module is missing, this method will return APR_EGENERAL.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic apr_status_t dbd_init(request_rec *r, const char *query, ap_dbd_t **dbdp,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if (!session_dbd_prepare_fn || !session_dbd_acquire_fn) {
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_prepare_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_prepare);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_acquire_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_acquire);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if (!session_dbd_prepare_fn || !session_dbd_acquire_fn) {
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01850)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "You must load mod_dbd to enable AuthDBD functions");
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01851)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "failed to acquire database connection");
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin statement = apr_hash_get(dbd->prepared, query, APR_HASH_KEY_STRING);
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01852)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "failed to find the prepared statement called '%s'", query);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Load the session by the key specified.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic apr_status_t dbd_load(request_rec * r, const char *key, const char **val)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *conf = ap_get_module_config(r->per_dir_config,
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01853)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "no SessionDBDselectlabel has been specified");
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin rv = dbd_init(r, conf->selectlabel, &dbd, &statement);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin rv = apr_dbd_pvbselect(dbd->driver, r->pool, dbd->handle, &res, statement,
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01854)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "query execution error saving session '%s' "
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "in database using query '%s': %s", key, conf->selectlabel,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin for (rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1)) {
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if (rv != 0) {
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01855)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "error retrieving results while saving '%s' "
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "in database using query '%s': %s", key, conf->selectlabel,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* we can't break out here or row won't get cleaned up */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Load the session by firing off a dbd query.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * If the session is anonymous, the session key will be extracted from
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * the cookie specified. Failing that, the session key will be extracted
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * from the GET parameters.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * If the session is keyed by the username, the session will be extracted
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * If no session is found, an empty session will be created.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * On success, this returns OK.
ca42f4cf489571eeb9c4ae3d83edebd2fb150fa8minfrinstatic apr_status_t session_dbd_load(request_rec * r, session_rec ** z)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *conf = ap_get_module_config(r->per_dir_config,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* is our session in a cookie? */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* first look in the notes */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin note = apr_pstrcat(r->pool, MOD_SESSION_DBD, name, NULL);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* load anonymous sessions */
5edf72b75a8549a34c150eda3c37b6368301fcefminfrin /* load an RFC2109 or RFC2965 compliant cookie */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* load named session */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* otherwise not for us */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* create a new session and return it */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin zz = (session_rec *) apr_pcalloc(r->pool, sizeof(session_rec));
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin apr_uuid_t *uuid = apr_pcalloc(zz->pool, sizeof(apr_uuid_t));
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* put the session in the notes so we don't have to parse it again */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Save the session by the key specified.
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrinstatic apr_status_t dbd_save(request_rec * r, const char *oldkey,
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin const char *newkey, const char *val, apr_int64_t expiry)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *conf = ap_get_module_config(r->per_dir_config,
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01856)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "no SessionDBDupdatelabel has been specified");
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin rv = dbd_init(r, conf->updatelabel, &dbd, &statement);
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin rv = apr_dbd_pvbquery(dbd->driver, r->pool, dbd->handle, &rows,
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01857) "query execution error updating session '%s' "
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin "using database query '%s': %s/%s", oldkey, newkey, conf->updatelabel, apr_dbd_error(dbd->driver, dbd->handle, rv));
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin * if some rows were updated it means a session existed and was updated,
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin * so we are done.
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin if (rows != 0) {
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01858)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "no SessionDBDinsertlabel has been specified");
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin rv = dbd_init(r, conf->insertlabel, &dbd, &statement);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin rv = apr_dbd_pvbquery(dbd->driver, r->pool, dbd->handle, &rows, statement,
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01859)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "query execution error inserting session '%s' "
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin "in database with '%s': %s", newkey, conf->insertlabel,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * if some rows were inserted it means a session was inserted, so we are
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if (rows != 0) {
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01860)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "the session insert query did not cause any rows to be added "
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin "to the database for session '%s', session not inserted", newkey);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Remove the session by the key specified.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic apr_status_t dbd_remove(request_rec * r, const char *key)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *conf = ap_get_module_config(r->per_dir_config,
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01862)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "no SessionDBDdeletelabel has been specified");
ca8584db70d0ff4d85cbfd912573688c41be27cfjailletc rv = dbd_init(r, conf->deletelabel, &dbd, &statement);
de4140a67ad59a391e40a6441ce3f040a17f17e5fuankg /* No need to do additional error logging here, it has already
de4140a67ad59a391e40a6441ce3f040a17f17e5fuankg been done in dbd_init if needed */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin rv = apr_dbd_pvbquery(dbd->driver, r->pool, dbd->handle, &rows, statement,
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01864)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "query execution error removing session '%s' "
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Clean out expired sessions.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * TODO: We need to figure out a way to clean out expired sessions from the database.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * The monitor hook doesn't help us that much, as we have no handle into the
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * server, and so we need to come up with a way to do this safely.
40965c37b2fd320093215de6c3fbd516382077eajimstatic apr_status_t dbd_clean(apr_pool_t *p, server_rec *s)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Save the session by firing off a dbd query.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * If the session is anonymous, save the session and write a cookie
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * containing the uuid.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * If the session is keyed to the username, save the session using
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * the username as a key.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * On success, this method will return APR_SUCCESS.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * @param r The request pointer.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * @param z A pointer to where the session will be written.
ca42f4cf489571eeb9c4ae3d83edebd2fb150fa8minfrinstatic apr_status_t session_dbd_save(request_rec * r, session_rec * z)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *conf = ap_get_module_config(r->per_dir_config,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* support anonymous sessions */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* don't cache pages with a session */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin apr_table_addn(r->headers_out, "Cache-Control", "no-cache");
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin /* if the session is new or changed, make a new session ID */
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin oldkey = apr_pcalloc(r->pool, APR_UUID_FORMATTED_LENGTH + 1);
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin newkey = apr_pcalloc(r->pool, APR_UUID_FORMATTED_LENGTH + 1);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* save the session with the uuid as key */
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin ret = dbd_save(r, oldkey, newkey, z->encoded, z->expiry);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* create RFC2109 compliant cookie */
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin ap_cookie_write(r, conf->name, newkey, conf->name_attrs, z->maxage,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* create RFC2965 compliant cookie */
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin ap_cookie_write2(r, conf->name2, newkey, conf->name2_attrs, z->maxage,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* save named session */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* don't cache pages with a session */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin apr_table_addn(r->headers_out, "Cache-Control", "no-cache");
2e1a0fb12bdf1c20064ffe900a8f44979ec946fcminfrin ret = dbd_save(r, r->user, r->user, z->encoded, z->expiry);
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01865)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "peruser sessions can only be saved if a user is logged in, "
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * This function performs housekeeping on the database, deleting expired
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * sessions.
40965c37b2fd320093215de6c3fbd516382077eajimstatic int session_dbd_monitor(apr_pool_t *p, server_rec *s)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin /* TODO handle housekeeping */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic void *create_session_dbd_dir_config(apr_pool_t * p, char *dummy)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin (session_dbd_dir_conf *) apr_pcalloc(p, sizeof(session_dbd_dir_conf));
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin return (void *) new;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic void *merge_session_dbd_dir_config(apr_pool_t * p, void *basev, void *addv)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *new = (session_dbd_dir_conf *) apr_pcalloc(p, sizeof(session_dbd_dir_conf));
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *add = (session_dbd_dir_conf *) addv;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *base = (session_dbd_dir_conf *) basev;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->name = (add->name_set == 0) ? base->name : add->name;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->name_attrs = (add->name_set == 0) ? base->name_attrs : add->name_attrs;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->name2 = (add->name2_set == 0) ? base->name2 : add->name2;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->name2_attrs = (add->name2_set == 0) ? base->name2_attrs : add->name2_attrs;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->peruser = (add->peruser_set == 0) ? base->peruser : add->peruser;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->peruser_set = add->peruser_set || base->peruser_set;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->remove = (add->remove_set == 0) ? base->remove : add->remove;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->remove_set = add->remove_set || base->remove_set;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->selectlabel = (!add->selectlabel) ? base->selectlabel : add->selectlabel;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->updatelabel = (!add->updatelabel) ? base->updatelabel : add->updatelabel;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->insertlabel = (!add->insertlabel) ? base->insertlabel : add->insertlabel;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin new->deletelabel = (!add->deletelabel) ? base->deletelabel : add->deletelabel;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * Sanity check a given string that it exists, is not empty,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * and does not contain special characters.
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic const char *check_string(cmd_parms * cmd, const char *string)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin if (APR_SUCCESS != ap_cookie_check_string(string)) {
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin return apr_pstrcat(cmd->pool, cmd->directive->directive,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin " cannot be empty, or contain '=', ';' or '&'.",
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic const char *
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin set_dbd_peruser(cmd_parms * parms, void *dconf, int flag)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic const char *
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin set_dbd_cookie_remove(cmd_parms * parms, void *dconf, int flag)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic const char *set_cookie_name(cmd_parms * cmd, void *config, const char *args)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *conf = (session_dbd_dir_conf *) config;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrinstatic const char *set_cookie_name2(cmd_parms * cmd, void *config, const char *args)
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin session_dbd_dir_conf *conf = (session_dbd_dir_conf *) config;
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AP_INIT_TAKE1("SessionDBDSelectLabel", ap_set_string_slot,
835d676191444a46d695171e8760d55a66c60fecminfrin (void *) APR_OFFSETOF(session_dbd_dir_conf, selectlabel), RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "Query label used to select a new session"),
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AP_INIT_TAKE1("SessionDBDInsertLabel", ap_set_string_slot,
835d676191444a46d695171e8760d55a66c60fecminfrin (void *) APR_OFFSETOF(session_dbd_dir_conf, insertlabel), RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "Query label used to insert a new session"),
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AP_INIT_TAKE1("SessionDBDUpdateLabel", ap_set_string_slot,
835d676191444a46d695171e8760d55a66c60fecminfrin (void *) APR_OFFSETOF(session_dbd_dir_conf, updatelabel), RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "Query label used to update an existing session"),
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AP_INIT_TAKE1("SessionDBDDeleteLabel", ap_set_string_slot,
835d676191444a46d695171e8760d55a66c60fecminfrin (void *) APR_OFFSETOF(session_dbd_dir_conf, deletelabel), RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "Query label used to delete an existing session"),
835d676191444a46d695171e8760d55a66c60fecminfrin AP_INIT_FLAG("SessionDBDPerUser", set_dbd_peruser, NULL, RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "Save the session per user"),
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin AP_INIT_FLAG("SessionDBDCookieRemove", set_dbd_cookie_remove, NULL, RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "Remove the session cookie after session load. On by default."),
835d676191444a46d695171e8760d55a66c60fecminfrin AP_INIT_RAW_ARGS("SessionDBDCookieName", set_cookie_name, NULL, RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "The name of the RFC2109 cookie carrying the session key"),
835d676191444a46d695171e8760d55a66c60fecminfrin AP_INIT_RAW_ARGS("SessionDBDCookieName2", set_cookie_name2, NULL, RSRC_CONF|OR_AUTHCFG,
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin "The name of the RFC2965 cookie carrying the session key"),
c06b2c98d38fd12b953ea9404f5314b3fddf91d8wrowe ap_hook_session_load(session_dbd_load, NULL, NULL, APR_HOOK_MIDDLE);
c06b2c98d38fd12b953ea9404f5314b3fddf91d8wrowe ap_hook_session_save(session_dbd_save, NULL, NULL, APR_HOOK_MIDDLE);
c06b2c98d38fd12b953ea9404f5314b3fddf91d8wrowe ap_hook_monitor(session_dbd_monitor, NULL, NULL, APR_HOOK_MIDDLE);
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin create_session_dbd_dir_config, /* dir config creater */
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin merge_session_dbd_dir_config, /* dir merger --- default is to
fd279fe992f7171dc3f6d4d40d6db5bb74f2d96eminfrin * override */