User not logged in, but user.login works

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by ziobudda on October 4, 2011 at 7:06am

Hi all, I have a problem that I can not understand. I'm using services 3.x with a D6 and I have this code:

$.post("http://mydomain.ext/pr1/system/connect", function(data) {

$.post("http://mydomain.ext/pr1/user/login", data.session_name+"="+sessid+"&username=foo&password=bar", function(data2) {
//alert(data2.user.uid);
sessid = data2.sessid;
session_name = data2.session_name;
$.cookie('PHPSESSIONID',data2.session_name);

$.post("http://mydomain.ext/pr1/user", 'PHPSESSIONID='+data2.session_name+'&'+data2.session_name+'='+data2.sessid+'&account[name]=foo&account[password]=bar&account[mail]=b%40b.it&',function(data3) {
alert(data3.sessid);
},'json');

},'json');

},'json');

"user/login" works because "data2" contains all user's data profile. And it contains sessid and session_name.
Now I can not understand how to execute some operation with this user. I have tried
- account[name]=foo&account[password]=bar&account[mail]=b%40b.it&
- data2.session_name+'='+data2.sessid+'&account[name]=foo&account[password]=bar&account[mail]=b%40b.it&
- 'PHPSESSIONID='+data2.session_name+'&'+data2.session_name+'='+data2.sessid+'&account[name]=foo&account[password]=bar&account[mail]=b%40b.it&

But I get always the same error because the user is considered "anonymous".

Where is my error ?

Tnx.

M.

Categories: ,

Comments

Same problem

Posted by josepvalls on January 16, 2012 at 5:14pm

I'm using Python

ProtocolError:

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /