0

Session Expired error on logout

Hello All

I am trying to logout, I am getting following error

{"error":{"code":28,"detail":"Session Expired Error","description":"Session Expired Error"},"code":28}

but i can still receive updates from other side. Can't understand what is wrong with my logout request.

following is the snippet of my logout please help


var logOutUrl:String = "http://"+
"rcore1.messenger.yahooapis.com" +
"/v1/session" +
"?"+
"_method=delete"+
"&c=" + session.crumb+
"&sid=" + session.sessionId +
"&realm=" + YahooConstants.realm+
"&oauth_consumer_key="+ YahooConstants.consumerKey+
"&oauth_nonce="+UIDUtil.getUID(new Date())+
"&oauth_signature_method=PLAINTEXT"+
"&oauth_timestamp="+new Date().getMilliseconds()/1000+
"&oauth_token="+session.oAuthToken+
"&oauth_version=1.0"+
"&oauth_signature="+YahooConstants.consumerSecret+ "%26"+ session.oAuthTokenSecret;
httpService.method = "DELETE";
httpService.contentType = "application/json;charset=utf-8";

httpService.url = logOutUrl;

httpService.send();

Regards
Asif Shaik

by
9 Replies
  • Hi asif, for logout method I use this code in java :

    CODE
    Random rand = new Random(System.currentTimeMillis() / 1000);

    String link3 = "http://developer.messenger.yahooapis.com/v1/session?";
    link3 += "&oauth_consumer_key=" + CONSUMER_KEY;
    link3 += "&oauth_nonce=" + rand.nextDouble();
    link3 += "&oauth_signature_method=" + "PLAINTEXT";
    link3 += "&oauth_timestamp=" + (System.currentTimeMillis() / 1000);
    link3 += "&oauth_token=" + OAUTH_TOKEN;
    link3 += "&oauth_version=" + "1.0";
    link3 += "&oauth_signature=" + CONSUMER_SECRET + "%26" + OAUTH_SECRET;
    link3 += "&sid=" + SESSION_ID;

    HttpClient hc = new DefaultHttpClient();
    HttpDelete get = new HttpDelete(link3);

    get.setHeader("Content-type", "application/json; charset=utf-8");

    Try this maybe it works...
    0
  • hi again,
    sorry for the late response.
    "http://developer.messenger.yahooapis.com/v1/session" = URL
    for log out I use: url = URL +
    "?oauth_consumer_key=" + CONSUMER_KEY +
    "&oauth_nonce=" + randNo.ToString() +
    "&oauth_signature=" + SECRET_KEY + "%26" + OAUTH_TOKEN_SECRET +
    "&oauth_signature_method=PLAINTEXT" +
    "&oauth_timestamp=" + DateTime.Now +
    "&oauth_token=" + OAUTH_TOKEN +
    "&oauth_version=1.0" +
    "&sid=" + SESSION_ID;
    after that I use HttpWebRequest x = WebRequest.create(url) as HttpWebRequest
    x.method = "DELETE";
    x.ContentType = "application/json; charset = utf-8" ;
    httpwebresponse y = x.getresponse() as httpwebresponse;

    can you help me with file_transfer?after i use action:invite, i get the get the response but when i need to use action: send, i have problems.
    0
  • Thanks for replying. By trying your approach I am not getting any error as I used to, but I receive following response

    {"primaryLoginId":<my UserName>}

    It doesn't actually log me out, I can see myself still online on the other end. With your approach It is not complaining(erroring) but it is not logging me out as well. Because I can see myself still online on other end, I am not going offline

    Any feedback would be very much appreciated .. :-(
    0
  • at httpwebresponse you shouldn;t have get that response.
    HttpWebResponse resp= x.GetResponse() as HttpWebResponse; you should be automaticly logged out. let me your yahoo email address if you still got that error. if it works for login it should work for logout too. in my case i can logout with that function
    0
  • try login again and than use that function.
    0
  • No, it doesn't work.

    Why are you using developer.messenger.yahooapis.com as server in delete URL, As per API we need to use rcore1.messenger.yahooapis.com as server Delete API
    0
  • look t the php examples. at every function it uses: developer.messenger.yahooapis.com. announce me if you succed with this
    0
  • it should work. in my case works with developer.....tell me if u succed
    0
  • Hey, I got Logout working I was too busy to announce here. The main reason due to which it worked was I had to send an JSON encoded empty body in the send
    httpService.send(JSON.encode({})); with POST method and I had to give "_method=delete" in its url. Thanks for your help
    0

Recent Posts

in Messenger IM SDK