40 $index = strtoupper( $name );
42 if ( isset( $this->cookie[$index] ) ) {
43 $this->cookie[$index]->set( $value, $attr );
45 $this->cookie[$index] =
new Cookie( $name, $value, $attr );
77 $len = strlen(
'Set-Cookie:' );
79 if ( substr_compare(
'Set-Cookie:', $cookie, 0, $len,
true ) === 0 ) {
80 $cookie = substr( $cookie, $len );
83 $bit = array_map(
'trim', explode(
';', $cookie ) );
85 if ( count( $bit ) >= 1 ) {
86 list( $name, $value ) = explode(
'=', array_shift( $bit ), 2 );
89 foreach ( $bit as $piece ) {
90 $parts = explode(
'=', $piece );
91 if ( count( $parts ) > 1 ) {
92 $attr[strtolower( $parts[0] )] = $parts[1];
94 $attr[strtolower( $parts[0] )] =
true;
98 if ( !isset( $attr[
'domain'] ) ) {
99 $attr[
'domain'] = $domain;
104 $this->
setCookie( $name, $value, $attr );