Not able to retrieve JSESSIONID cookie with AXIOSRetrieve the position (X,Y) of an HTML elementHow do I set/unset a cookie with jQuery?Local Storage vs CookiesSet cookie and get cookie with JavaScriptSet-Cookie in HTTP header is ignored with AngularJSHow to prevent JSESSIONID cookie from being encoded in HTTP request headerHow to send Basic Auth with axiosHow to set cross domain cookie in KoaConfigure Axios and Flask to use CORS with cookiesAngular 2 not passing JSESSIONID on subsequent requests

Shrink exponential fraction argument

What happens to foam insulation board after you pour concrete slab?

Traffic law UK, pedestrians

If Boris Johnson were prosecuted and convicted of lying about Brexit, can that be used to cancel Brexit?

How certain is a caster of when their spell will end?

I wrote a scene that the majority of my readers loved. How do I get back to that place while writing my new book?

Building a road to escape Earth's gravity by making a pyramid on Antartica

Short story written from alien perspective with this line: "It's too bright to look at, so they don't"

Accidentally renamed tar.gz file to a non tar.gz file, will my file be messed up

Secure offsite backup, even in the case of hacker root access

Explain Ant-Man's "not it" scene from Avengers: Endgame

Do manufacturers try make their components as close to ideal ones as possible?

Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?

What is a simple, physical situation where complex numbers emerge naturally?

Why is Colorado so different politically from nearby states?

Applicants clearly not having the skills they advertise

Is it legal in the UK for politicians to lie to the public for political gain?

How can Iron Man's suit withstand this?

Opposite of "Squeaky wheel gets the grease"

Accidentally cashed a check twice

What happens if you do emergency landing on a US base in middle of the ocean?

Did Darth Vader wear the same suit for 20+ years?

Java 8: How to convert String to Map<String,List<String>>?

Do I include animal companions when calculating difficulty of an encounter?



Not able to retrieve JSESSIONID cookie with AXIOS


Retrieve the position (X,Y) of an HTML elementHow do I set/unset a cookie with jQuery?Local Storage vs CookiesSet cookie and get cookie with JavaScriptSet-Cookie in HTTP header is ignored with AngularJSHow to prevent JSESSIONID cookie from being encoded in HTTP request headerHow to send Basic Auth with axiosHow to set cross domain cookie in KoaConfigure Axios and Flask to use CORS with cookiesAngular 2 not passing JSESSIONID on subsequent requests






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-1















I am trying to call API to authenticate user. getting 200 success response but not getting JSESSIONID cookie in response.



axios.defaults.withCredentials = 'true';
axios.defaults.crossDomain = 'true';
axios.defaults.headers.post['Content-Type'] = 'application/json';
axios.defaults.headers.post['withCredentials'] = 'true';
const data =
username: this.state.user,
credential: this.state.pass


axios.post('http://3.122.7.162:5000/v60/admin/session', data)
.then(response =>
console.log("response");
console.log(response);
)
.catch(error =>
console.log("error");
console.log(error);
);


Thanks










share|improve this question






























    -1















    I am trying to call API to authenticate user. getting 200 success response but not getting JSESSIONID cookie in response.



    axios.defaults.withCredentials = 'true';
    axios.defaults.crossDomain = 'true';
    axios.defaults.headers.post['Content-Type'] = 'application/json';
    axios.defaults.headers.post['withCredentials'] = 'true';
    const data =
    username: this.state.user,
    credential: this.state.pass


    axios.post('http://3.122.7.162:5000/v60/admin/session', data)
    .then(response =>
    console.log("response");
    console.log(response);
    )
    .catch(error =>
    console.log("error");
    console.log(error);
    );


    Thanks










    share|improve this question


























      -1












      -1








      -1








      I am trying to call API to authenticate user. getting 200 success response but not getting JSESSIONID cookie in response.



      axios.defaults.withCredentials = 'true';
      axios.defaults.crossDomain = 'true';
      axios.defaults.headers.post['Content-Type'] = 'application/json';
      axios.defaults.headers.post['withCredentials'] = 'true';
      const data =
      username: this.state.user,
      credential: this.state.pass


      axios.post('http://3.122.7.162:5000/v60/admin/session', data)
      .then(response =>
      console.log("response");
      console.log(response);
      )
      .catch(error =>
      console.log("error");
      console.log(error);
      );


      Thanks










      share|improve this question
















      I am trying to call API to authenticate user. getting 200 success response but not getting JSESSIONID cookie in response.



      axios.defaults.withCredentials = 'true';
      axios.defaults.crossDomain = 'true';
      axios.defaults.headers.post['Content-Type'] = 'application/json';
      axios.defaults.headers.post['withCredentials'] = 'true';
      const data =
      username: this.state.user,
      credential: this.state.pass


      axios.post('http://3.122.7.162:5000/v60/admin/session', data)
      .then(response =>
      console.log("response");
      console.log(response);
      )
      .catch(error =>
      console.log("error");
      console.log(error);
      );


      Thanks







      javascript reactjs cookies cors axios






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 13:13







      tbaveja

















      asked Mar 24 at 4:52









      tbavejatbaveja

      238




      238






















          1 Answer
          1






          active

          oldest

          votes


















          0














          XMLHttpRequest and fetch (the built-in HTTP request libraries in browsers) do not expose information about cookies in their response object.



          It isn't even available through directly reading the Set-Cookie header because it is a forbidden response header.



          The only way to read cookie data is through document.cookie, but that only provides information about same origin cookies.



          There is no direct way to get the data from a cross-origin cookie using Ajax methods. The only way to do it would be to change the server side code so it returned a copy of the cookie data through another path that the JavaScript could read (e.g. in the response body).




          This doesn't stop you using the cookies. Unless third-party cookies are disabled, they will still be set in the browser's cookie jar and automatically sent with future requests to the domain they belong to.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55320839%2fnot-able-to-retrieve-jsessionid-cookie-with-axios%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            XMLHttpRequest and fetch (the built-in HTTP request libraries in browsers) do not expose information about cookies in their response object.



            It isn't even available through directly reading the Set-Cookie header because it is a forbidden response header.



            The only way to read cookie data is through document.cookie, but that only provides information about same origin cookies.



            There is no direct way to get the data from a cross-origin cookie using Ajax methods. The only way to do it would be to change the server side code so it returned a copy of the cookie data through another path that the JavaScript could read (e.g. in the response body).




            This doesn't stop you using the cookies. Unless third-party cookies are disabled, they will still be set in the browser's cookie jar and automatically sent with future requests to the domain they belong to.






            share|improve this answer



























              0














              XMLHttpRequest and fetch (the built-in HTTP request libraries in browsers) do not expose information about cookies in their response object.



              It isn't even available through directly reading the Set-Cookie header because it is a forbidden response header.



              The only way to read cookie data is through document.cookie, but that only provides information about same origin cookies.



              There is no direct way to get the data from a cross-origin cookie using Ajax methods. The only way to do it would be to change the server side code so it returned a copy of the cookie data through another path that the JavaScript could read (e.g. in the response body).




              This doesn't stop you using the cookies. Unless third-party cookies are disabled, they will still be set in the browser's cookie jar and automatically sent with future requests to the domain they belong to.






              share|improve this answer

























                0












                0








                0







                XMLHttpRequest and fetch (the built-in HTTP request libraries in browsers) do not expose information about cookies in their response object.



                It isn't even available through directly reading the Set-Cookie header because it is a forbidden response header.



                The only way to read cookie data is through document.cookie, but that only provides information about same origin cookies.



                There is no direct way to get the data from a cross-origin cookie using Ajax methods. The only way to do it would be to change the server side code so it returned a copy of the cookie data through another path that the JavaScript could read (e.g. in the response body).




                This doesn't stop you using the cookies. Unless third-party cookies are disabled, they will still be set in the browser's cookie jar and automatically sent with future requests to the domain they belong to.






                share|improve this answer













                XMLHttpRequest and fetch (the built-in HTTP request libraries in browsers) do not expose information about cookies in their response object.



                It isn't even available through directly reading the Set-Cookie header because it is a forbidden response header.



                The only way to read cookie data is through document.cookie, but that only provides information about same origin cookies.



                There is no direct way to get the data from a cross-origin cookie using Ajax methods. The only way to do it would be to change the server side code so it returned a copy of the cookie data through another path that the JavaScript could read (e.g. in the response body).




                This doesn't stop you using the cookies. Unless third-party cookies are disabled, they will still be set in the browser's cookie jar and automatically sent with future requests to the domain they belong to.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 24 at 13:17









                QuentinQuentin

                667k749041067




                667k749041067





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55320839%2fnot-able-to-retrieve-jsessionid-cookie-with-axios%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현