几乎一整天我都在努力解决这个问题。
我$result = curl_exec($ch);
用来读取响应,我想获得如下所示的 Set-cookie 标头:
Set-Cookie: JSESSIONID=05a0c785d8e2f4856a3f844e3694; Path=/qos; HttpOnly rememberMe=deleteMe; Path=/qos; Max-Age=0; Expires=Thu, 06-Sep-2012 10:50:20 GMT rememberMe=x+8X9hDZEUwM23osStzBmHs6FV/4VJAy18j4gjswG0H9wYKtOsSLu4p4XQ2KjLReNN4V2NokyjT66QkWzYetsde /Gbvmb9iJgV3VsuCvRgFpEFsduig5wHwu0YXjVgQWheiK87+5CNQE1X06z8mbPKu2GZUE/vwUUraR66ZAfxPdRKM24NKJ7HV4UIAPspudvCTJzFRqfkwb+pw cqnslyB6Rb/LB+pqHx2oshnINTwNd1E25+Zjs8qGQFQnHRvI4mRGF+BHC1JPGBV2GD9F7K29+szUlAGJhKr7FtOV1ELhN4JMqP4yuGDH0Dt9naLbRr6oFxxB 9t1+N5gHKVOE0vL5VM54Is5nAnWmhUrx9r3+R99We5phw7XuE1svlcOq2XrVeRJthMy3Xfp70cobUBdN/bOh5/ih9/wg3XwpagsGUKf1raP9mGO4ShDd+NFg8Z+eC+80Yt2wkS+7ZH/UGNh73LkdtCv6WlgFqiB/po20Lu+gCbDEceKt+lTNlU2c1; Path=/qos; Max-Age=15724800; Expires=Fri, 08-Mar-2013 10:50:20 GMT; HttpOnly
我想用';'分开它们 字符。
编辑:
下面的解决方案并没有像我想象的那样工作。也许是因为我的结果中有其他标题:
Status Code: 200 OK
Content-Length: 0
Date: Fri, 07 Sep 2012 10:50:20 GMT
Server: GlassFish Server Open Source Edition 3.1.1
Set-Cookie: JSESSIONID=05a0c785d8e2f4856a3f844e3694; Path=/qos; HttpOnly rememberMe=deleteMe; Path=/qos; Max-Age=0; Expires=Thu, 06-Sep-2012 10:50:20 GMT rememberMe=x+8X9hDZEUwM23osStzBmHs6FV/4VJAy18j4gjswG0H9wYKtOsSLu4p4XQ2KjLReNN4V2NokyjT66QkWzYetsde /Gbvmb9iJgV3VsuCvRgFpEFsduig5wHwu0YXjVgQWheiK87+5CNQE1X06z8mbPKu2GZUE/vwUUraR66ZAfxPdRKM24NKJ7HV4UIAPspudvCTJzFRqfkwb+pw cqnslyB6Rb/LB+pqHx2oshnINTwNd1E25+Zjs8qGQFQnHRvI4mRGF+BHC1JPGBV2GD9F7K29+szUlAGJhKr7FtOV1ELhN4JMqP4yuGDH0Dt9naLbRr6oFxxB 9t1+N5gHKVOE0vL5VM54Is5nAnWmhUrx9r3+R99We5phw7XuE1svlcOq2XrVeRJthMy3Xfp70cobUBdN/bOh5/ih9/wg3XwpagsGUKf1raP9mGO4ShDd+NFg8Z+eC+80Yt2wkS+7ZH/UGNh73LkdtCv6WlgFqiB/po20Lu+gCbDEceKt+lTNlU2c1; Path=/qos; Max-Age=15724800; Expires=Fri, 08-Mar-2013 10:50:20 GMT; HttpOnly
我只需要 Set-cookie