-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Cookies do not appear to be being sent #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It turns out I wasn't actually adding the PersistentCookieStore to the AsyncHttpClient. Sorry about that! |
Make sure you are setting the version/domain/path on the BasicClientCookie you are creating. For example:
If you add a cookie like this to the PersistentCookieStore then it will get sent along with requests to my.domain.com |
Nevermind, I found my mistake. My cookies were being overwritten when i went from http to https. Great job with the asyncClient, it works great. I'm having trouble using stored cookies with a request. I used the following lines to instantiate the AsyncHttpClient and automatically add cookies from my server: I use the following line to make requests: AsyncClient.get(urlStr, new AsyncHttpResponseHandler(); I made requestA to fetch & store session cookies in myCookieStore. When I make requestB it seems like the stored cookies are not sent along with my request. Am I missing any steps here? Thanks for your help. |
…0d860eee6fa67ef00958da0eae1aef01 Recent changes at original repo working with refactored response handlers
hello guys. am abit late but i need your help. private void init() {
PersistentCookieStore myCookies = new PersistentCookieStore(mContext);
if (mContext == null) {
Log.d("WebClient", "Warning Context is null. Cookies wont work");
}
List<Cookie> cookies = myCookies.getCookies();
Log.d("WebClient", "Cookies " + cookies.size());
for (Cookie c : cookies) {
String cookieName = "";
String cookieValue = "";
cookieName = c.getName().toString();
cookieValue = c.getValue().toString();
Log.d("WebClient", "Cookie Name:" + cookieName + " Cookie Value: " + cookieValue);
}
client.setCookieStore(myCookies);
} and here is my logcat
when the first request is made the server sends back cookies for authentication on the subsequent requests. but it seems the cookies are not saved. see the cookie count! |
@griffins open up a new ticket please, don't append such questions to old tickets. |
I created a BasicClientCookie, added it to a PersistentCookieStore, followed by setting the CookieStore in the AsyncHttpClient but the Cookie field does not appear to be set in the request. I'm not sure if I'm missing something.
The text was updated successfully, but these errors were encountered: