Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logout seems not working in test.html #66

Open
dgurwan opened this issue Mar 20, 2017 · 4 comments
Open

logout seems not working in test.html #66

dgurwan opened this issue Mar 20, 2017 · 4 comments
Labels

Comments

@dgurwan
Copy link

dgurwan commented Mar 20, 2017

When running test.html, logout doesnt not work, any clues ? here's console log

GET
XHR
http://drupal-7-26.dd:8083/ [HTTP/1.1 200 OK 549 ms]
"POST: http://drupal-7-26.dd:8083/?q=rest/system/connect.json" jdrupal.min.js:2:63
OPTIONS
XHR
http://drupal-7-26.dd:8083/ [HTTP/1.1 200 OK 524 ms]
POST
XHR
http://drupal-7-26.dd:8083/ [HTTP/1.1 200 OK 599 ms]
200 - OK

All is ok , when clicking on login, a popup is displayed with "Hi admin-local", seems good... but logout

"POST: http://drupal-7-26.dd:8083/?q=rest/user/logout.json" jdrupal.min.js:2:63
OPTIONS
XHR
http://drupal-7-26.dd:8083/ [HTTP/1.1 200 OK 542 ms]
POST
XHR
http://drupal-7-26.dd:8083/ [HTTP/1.1 406 Not Acceptable : User is not logged in. 637 ms]
"POST: http://drupal-7-26.dd:8083/?q=rest/user/logout.json - 406 - Not Acceptable : User is not logged in." jdrupal.min.js:2:547

["User is not logged in."] jdrupal.min.js:2:631
Expires: Sun, 19 Nov 1978 05:00:00 GMT

Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0

Last-Modified: Mon, 20 Mar 2017 22:17:06 GMT

Content-Type: application/json

@dgurwan dgurwan changed the title logout logout seems not working in test.html Mar 20, 2017
@signalpoint
Copy link
Owner

@dgurwan What URL are you running the tests at? I suspect the domain on the URL is different than http://drupal-7.26.dd:8083. If the domain is different, then you're experiencing what is referred to as CORS. There's plenty of DrupalGap/Drupal related issues discussing CORS which will help you.

FYI, Drupal 7.26 is super duper in secure... I'd advise upgrading if you haven't.

@dgurwan
Copy link
Author

dgurwan commented Mar 21, 2017

@signalpoint , test is running on localhost as drupal-7.26.dd:8083 which is declared in my host file. I use FF with cors module to Allow-Control-Allow-Origin: *.

I know that 7.26 is really old, but can not change it for now unfortunately.. Does the pb can be a session pb on service module,by the way i checked "Session authentication" in my service.

thx by advance :)

@dgurwan
Copy link
Author

dgurwan commented Mar 21, 2017

@signalpoint , I just tried with a fresh drupal installation (7.46 + libraries + Services ) on remote site (http://myangulardrupal3neb62rbwg.devcloud.acquia-sites.com), connect is all good, but not logout.

Let me know if i'm doing wrong

@signalpoint
Copy link
Owner

@dgurwan

406 - Not Acceptable : User is not logged in.

This leads me to believe that there may be something wrong with the Drupal cookie and the cookie domain configuration. Fortunately/unfortunately, I've never had to deal with this in any of my hosting environments, but I've heard many others mention a "Drupal cookie domain".

I think this could be a problem with Acquia vs. the Services module, but I'm not familiar with Acquia's environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants