Logout REST method returning 'Session expired or invalid

Posted by SteveBos on 23-Mar-2017 10:24

Hello, 

We have an app that logs into a rollbase session, gets a few pieces of information, then logs out. Everything works great until the logout part. Here is my code and subsequent error and output.

diyLogout: function (success, error) {
     logWriter.writeLog("model.js",0,"diyLogout");
     var data2 = {
     "sessionID": dmsi.model.session.diySessionID,
     "output": "json"
     };
     this._ajaxCall2("GET", "logout", data2, success, error);
},

_ajaxCall2: function (type, method, data, success, error) {

    var rollbaseUrl = dmsi.config.rollbaseSettings.baseUrl + method + '?' + $.param(data);

    var options2 = {
    url: rollbaseUrl,
    contentType: 'application/json',
    success: function (rsp) {
    success(rsp);
          }
    }

    $.ajax(options2).fail(function (err) {

         logWriter.writeLog("model.js",0,"ajaxCall2 failed");

         console.log(err);
     });
},

diy.dmsi.com/.../logout 403 (Forbidden)
Object {readyState: 4, responseText: "{ "status": "login", "message": "Session expired or invalid login credentials" }", responseJSON: Object, status: 403, statusText: "Forbidden"}

I've triple checked the session id against the user access log so I know it's valid. Now, that user was already logged in so rollbase kicked the previous one out. Could that be the cause? This should be about as straight forward as it gets so what am I missing?

Thanks

All Replies

Posted by Ricardo Rafols on 28-Mar-2017 09:56

Hi Steve,

Try using sessionId instead of sessionID when creating data2 array.

Your program is doing:

diy.dmsi.com/.../logoutsessionID=3b14734102074688934d4aed28f4b607%401&output=json

but should be doing:

diy.dmsi.com/.../logoutsessionId=3b14734102074688934d4aed28f4b607%401&output=json

Regards,
Ricardo

Posted by SteveBos on 28-Mar-2017 10:17

Arrggghhh! I wish I could say that's the first time I've been bitten by that. Thanks Ricardo!

This thread is closed