util_cookies.c revision ab364c14d11072380abeab42015e19c3db3336c1
230N/A/* Licensed to the Apache Software Foundation (ASF) under one or more 230N/A * contributor license agreements. See the NOTICE file distributed with 230N/A * this work for additional information regarding copyright ownership. 230N/A * The ASF licenses this file to You under the Apache License, Version 2.0 230N/A * (the "License"); you may not use this file except in compliance with 230N/A * the License. You may obtain a copy of the License at 230N/A * Unless required by applicable law or agreed to in writing, software 230N/A * distributed under the License is distributed on an "AS IS" BASIS, 230N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 230N/A * See the License for the specific language governing permissions and 230N/A * limitations under the License. 230N/A * Write an RFC2109 compliant cookie. 230N/A * @param name The name of the cookie. 230N/A * @param val The value to place in the cookie. 230N/A * @param attrs The string containing additional cookie attributes. If NULL, the 230N/A * DEFAULT_ATTRS will be used. 230N/A * @param maxage If non zero, a Max-Age header will be added to the cookie. /* create RFC2109 compliant cookie */ /* write the cookie to the header table(s) provided */ * Write an RFC2965 compliant cookie. * @param name2 The name of the cookie. * @param val The value to place in the cookie. * @param attrs2 The string containing additional cookie attributes. If NULL, the * DEFAULT_ATTRS will be used. * @param maxage If non zero, a Max-Age header will be added to the cookie. /* create RFC2965 compliant cookie */ /* write the cookie to the header table(s) provided */ * Remove an RFC2109 compliant cookie. * @param name The name of the cookie. /* create RFC2109 compliant cookie */ /* write the cookie to the header table(s) provided */ * Remove an RFC2965 compliant cookie. * @param name2 The name of the cookie. /* create RFC2965 compliant cookie */ /* write the cookie to the header table(s) provided */ /* Iterate through the cookies, isolate our cookie and then remove it. * If our cookie appears two or more times, but with different values, * remove it twice and set the duplicated flag to true. Remove any * $path or other attributes following our cookie if present. If we end * up with an empty cookie, remove the whole header. /* find the cookie called name */ /* any cookies left over? */ * Read a cookie called name, placing its value in val. * Both the Cookie and Cookie2 headers are scanned for the cookie. * If the cookie is duplicated, this function returns APR_EGENERAL. If found, * and if remove is non zero, the cookie will be removed from the headers, and * thus kept private from the backend. "Cookie",
"Cookie2",
NULL);
"client submitted cookie '%s' more than once: %s", v.
name, r->
uri);
/* remove our cookie(s), and replace them */ * Sanity check a given string that it exists, is not empty, * and does not contain the special characters '=', ';' and '&'. * It is used to sanity check the cookie names.