Advertisement
Guest User

Untitled

a guest
Aug 6th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. Request URL: http://104.236.232.23/api/user/login/?Email=haye123%40gmail.com&Password=password&_=1438891065386
  2. Request Method: GET
  3. Status Code: HTTP/1.1 200 OK
  4. Request Headers 13:06:42.000
  5. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0
  6. Origin: null
  7. Host: 104.236.232.23
  8. Connection: keep-alive
  9. Cache-Control: max-age=0
  10. Accept-Language: en-US,en;q=0.5
  11. Accept-Encoding: gzip, deflate
  12. Accept: */*
  13. Sent Cookie
  14. sessionid: 2w5vttprgffpb9q9mu395ko1lfz3hv54
  15. csrftoken: NeEbmb3yKOpnb6IMLi5CCXKOYJwCe0ys
  16. Response Headers Δ267ms
  17. X-Frame-Options: SAMEORIGIN
  18. Vary: Cookie
  19. Server: nginx/1.4.6 (Ubuntu)
  20. p3p: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"
  21. Date: Thu, 06 Aug 2015 20:06:43 GMT
  22. Content-Type: application/json
  23. Content-Length: 385
  24. Connection: keep-alive
  25.  
  26. Request URL: http://104.236.232.23/api/user/login/?Email=haye123%40gmail.com&Password=password&_=1438891656317
  27. Request Method: GET
  28. Status Code: HTTP/1.1 200 OK
  29. Request Headers 13:07:36.000
  30. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0
  31. Host: 104.236.232.23
  32. Connection: keep-alive
  33. Accept-Language: en-US,en;q=0.5
  34. Accept-Encoding: gzip, deflate
  35. Accept: */*
  36. Sent Cookie
  37. sessionid: 2w5vttprgffpb9q9mu395ko1lfz3hv54
  38. csrftoken: NeEbmb3yKOpnb6IMLi5CCXKOYJwCe0ys
  39. Response Headers Δ123ms
  40. X-Frame-Options: SAMEORIGIN
  41. Vary: Cookie
  42. Server: nginx/1.4.6 (Ubuntu)
  43. p3p: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"
  44. Date: Thu, 06 Aug 2015 20:07:37 GMT
  45. Content-Type: application/json
  46. Content-Length: 385
  47. Connection: keep-alive
  48. Response Body Δ0ms
  49. {"last_name": "Name", "profile_image": "https://", "background_image": "", "is_staff": true, "id": 99, "date_joined": "01/09/2015", "first_name": "Aaron", "about_text": "", "gender": "", "age": null, "company_name": "0", "is_pro": false, "email": "email@gmail.com", "website_url": ""}
  50.  
  51. function Login2() {
  52.  
  53. if( xhr != null ) {
  54. xhr.abort();
  55. xhr = null;
  56. }
  57.  
  58. ajax_url = "http://104.236.232.23/api/user/login/";
  59. ajax_type = "GET";
  60. ajax_data = {'Email' : "email@gmail.com", 'Password' : "password" };
  61.  
  62. xhr = $.ajax({
  63. url: ajax_url,
  64. type: ajax_type,
  65. data: ajax_data,
  66. crossDomain: true,
  67. dataType: 'json',
  68. xhrFields: {
  69. withCredentials: true
  70. },
  71. headers: {
  72. 'Accept': '*/*'
  73. },
  74. success: function(data, textStatus, XMLHttpRequest){
  75.  
  76.  
  77.  
  78. alert("boom");
  79. var cookietoSet=XMLHttpRequest.getResponseHeader('Set-Cookie');
  80.  
  81. Set_Cookie(cookietoSet.split('=')[0],cookietoSet.split('=')[1],expires, path, domain, secure)//change as per ur needs
  82.  
  83.  
  84.  
  85.  
  86. }, //close success
  87.  
  88. error: function( jqXHR, textStatus ){
  89. alert( "Request failed: " + textStatus );
  90. }
  91. });
  92.  
  93. } //end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement