URL session is not maintaining in android -
i working on android project , using session check whether user logged in or not. have url below.
http://www.mywebservice.com/app/app.asmx/isuserlogged
when login, session on server have userid. using above trying check current session have userid or not, says user not logged in.
below code used
private void isuserlogged(){ mloading.setvisibility(view.visible); globalfunctions.disablelayout(mainlayout); log.d("executebidauction", act.getstring(r.string.isuserlogged)); stringrequest login = new stringrequest( act.getstring(r.string.isuserlogged), new response.listener<string>() { @override public void onresponse(string response) { if (response != null) { log.e("response isuserlogged",""+response.replace("\"","")); } } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror volleyerror) { mloading.setvisibility(view.invisible); globalfunctions.enablelayout(mainlayout); if (volleyerror.networkresponse != null) { switch (volleyerror.networkresponse.statuscode) { case 200: toast.maketext(act, volleyerror.getmessage(), toast.length_long).show(); break; case 500: toast.maketext(act, "sorry, internal server error", toast.length_short).show(); break; case 404: toast.maketext(act, "sorry, not found", toast.length_short).show(); break; default: break; } } else { toast.maketext(act, "check network connection", toast.length_long).show(); } } } ); login.setshouldcache(false); login.setretrypolicy(new defaultretrypolicy(10 * 1000, 2, 1.0f)); login.settag(tag); appcontroller.getinstance().addtorequestqueue(login, tag); }
can point me why response not logged in? call login webservice , call isuserlogged, still says user not logged in.
can point doing wrong?
this working perfect in iphone
- you can cookies first response .
- then set cookies using
connection.setrequestproperty("cookie",cookie_value);
i had same issue & solved setting cookie values . me , working fine in iphone application .
Comments
Post a Comment