session information from OKTech WS

session information from OKTech WS

by amol gupta -
Number of replies: 3

Hi,

I am using oktech webservices for android moodle client and I want to open a webview after a user has logged into the android app. I see that the login function returns a "sessionkey" (eg reponse login : loginReturn{client=91; sessionkey=6f7a209f7e4faa4341e3ec55fee82f3a).Also moodle sets a cookie with name MoodleSession.Are the two related? How do i use it to access the system without logging in again.

Please suggest

Thank you smile

Average of ratings: -
In reply to amol gupta

Re: session information from OKTech WS

by Federico Leverato -

Well, that's easy. If you had looked at any of the other web services, you would know the anser too: you just use the two values (client=91; sessionkey=6f7a209f7e4faa4341e3ec55fee82f3a) in the following requests. Don't know about the cookie but I don't think it's useful from android.

Other solution is using REST style request instead of SOAP, so the login information travels along the other parameters every time and you also avoid session timeout issues.

In reply to Federico Leverato

Re: session information from OKTech WS

by amol gupta -

I see that each time we nee to call a function from OKTech WS, I require the sessionkey. But my question is how to send this session key to the webview so that the site does not ask for the login details again and go directly to the requested page.

In reply to amol gupta

Re: session information from OKTech WS

by Patrick Pollet -

@amol,

There is no relation whatsoever between the client/sessionkey pair sent by OK Tech WS at login and some Moodle cookie sent when an user logs in to Moodle using a browser. So currently, your smartphones users will have to 're-log' to Moodle  if they swap to webview.

Sorry.