Using Drupal Services I am able to log in but each time I post a node it posts as anonymous. I get the session id and session name upon login but can´t pass it along with a POST no matter what i try.

I have tried including it in the json string, as a header and within the URL - without any result. I'm testing using the Chrome Postman as REST client.

What am I doing wrong?

Thank you for any help!

var session_id = $('#session_id').text();
  type: "POST",
  url: 'http://www.website.com/active_services/node?sessid='+session_id, 
  data: JSON.stringify(noden),
  headers : {
    "Authorization" : session_id,
    "sessid" : session_id,
    "sessionid" : session_id,
  beforeSend: function (req){
    req.setRequestHeader("Content-Type", "application/json");
  dataType: 'json',
  contentType: 'application/json',
  success: function(data){
  • Are you using any REST client to test this out ?
    – niksmac
    Mar 9, 2013 at 2:35

1 Answer 1


I am using POSTMAN to test my REST calls to server.

When i try http://mysite.com/api/endpoint/users/login.json

with parametes

  1. Content-Type - application/json

  2. username - A valid username on site

  3. password - users password

I get a json looks like this

    "sessid": "6nRaPdlYfV4mDt0cgUHfGwNmWJZNvUfKM618DYY4unc",
    "session_name": "SESS4356595e5cb4b5df8f18058cfbd8d13a",
    "user": {
        "uid": "144",

From that i suspect you should pass sessid and session_name to get it work.

Try it and let me know whether its working if not we find some other solution which works :)

enter image description here

  • Thank you for your response! I have always been able to receive the session name and ID without a problem. The problem is that I can't pass them when I'm POSTing a node-create. I test using Chrome Postman as well. How should I setup my ajax POST above so the session info gets correctly transferred and I post as a signed in user? @Nikhilm
    – MDDY
    Mar 9, 2013 at 10:43
  • Just login to website in other tab :)
    – niksmac
    Mar 11, 2013 at 11:08
  • But im not using a browser, I'm creating an iPhone app that connects to the Drupal services API. Any ideas? :) @Nikhilm
    – MDDY
    Mar 11, 2013 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.