-
- FOREACH_KEY(pos, zoption, cookie_key, cookie_idx) {
- if (cookie_key) {
- zval **cookie_val;
- if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void **) &cookie_val, &pos)) {
- zval *cpy, *val = convert_to_type_ex(IS_STRING, *cookie_val, &cpy);
-
- phpstr_appendf(&request->_cache.cookies, "%s=%s; ", cookie_key, Z_STRVAL_P(val));
-
- if (cpy) {
- zval_ptr_dtor(&cpy);
- }
- }
-
- /* reset */
- cookie_key = NULL;
- }
- }
-
- if (request->_cache.cookies.used) {
+ if (SUCCESS == http_urlencode_hash_recursive(HASH_OF(zoption), &request->_cache.cookies, "; ", sizeof("; ")-1, NULL, 0)) {