Cookie not passed to request of react.model.json | Community
Skip to main content
aquavento
October 17, 2018
Solved

Cookie not passed to request of react.model.json

  • October 17, 2018
  • 5 replies
  • 4146 views

Hi,

Trying to get the sample SPA app (we.retail.journal) running. I face an issue with the react.model.json

The cookie is not passed in the request, so i get redirected to the loging page.

This prevents the site being properly loaded.

Any Idea how I can make AEM send the cookie along with the request?

Below you find the headers.

General:

  1. Request URL: http://localhost:4502/content/we-retail-journal/react.model.json
  2. Request Method: GET
  3. Status Code: 302 Found
  4. Remote Address: [::1]:4502
  5. Referrer Policy: no-referrer-when-downgrade

Request Header:

  1. Accept: */*
  2. Accept-Encoding: gzip, deflate, br
  3. Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
  4. Cache-Control: no-cache
  5. Connection: keep-alive
  6. Host: localhost:4502
  7. Pragma: no-cache
  8. Referer: http://localhost:4502/content/we-retail-journal/react.html
  9. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36

Response Header:

HTTP/1.1 302 Found Date: Wed, 17 Oct 2018 11:43:27 GMT Location: http://localhost:4502/libs/granite/core/content/login.html?resource=%2Fcontent%2Fwe-retail-journal%2Freact.model.json&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown Content-Length: 0

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Daniel_Gordon

Hi aquavento,

Are you logged into AEM in the browser and navigating to: http://localhost:4502/content/we-retail-journal/react/home.html  ?

It shouldn't prompt you to authenticate the ajax request. Also what version of AEM and We.Retail journal app are you using?

It is designed for AEM 6.4 + SP2. You can find the latest version of the We.Retail Journal here: GitHub - adobe/aem-sample-we-retail-journal: We.Retail Journal is a sample showcasing SPA Editing capabilities in AEM us…

5 replies

Daniel_Gordon
Adobe Employee
Daniel_GordonAdobe EmployeeAccepted solution
Adobe Employee
October 18, 2018

Hi aquavento,

Are you logged into AEM in the browser and navigating to: http://localhost:4502/content/we-retail-journal/react/home.html  ?

It shouldn't prompt you to authenticate the ajax request. Also what version of AEM and We.Retail journal app are you using?

It is designed for AEM 6.4 + SP2. You can find the latest version of the We.Retail Journal here: GitHub - adobe/aem-sample-we-retail-journal: We.Retail Journal is a sample showcasing SPA Editing capabilities in AEM us…

smacdonald2008
Level 10
October 18, 2018

Excellent answer Danial. The new WKDN doc will help many AEM DEV interested in SPA!

In addition - keep you eye out soon for an AEM Ask the Community Experts session on AEM And SPA - looks like this will be scheduled for Jan 2019.

aquavento
aquaventoAuthor
October 22, 2018

Hi, thanks for your feedback.

Yes I'm logged in. I can see how the cookies are passed in other request before and after the particular call to the react.model.json.

I face the same issue when trying to get Adobe Experience Manager Help | Getting Started with the AEM SPA Editor - Chapter 0 running.

Running AEM 6.4

And Service Pack 2 is installed:

Any Idea what could cause this problem?

aquavento
aquaventoAuthor
October 23, 2018

adding

{
  credentials: 'include' 
}

to the fetch() which retreives the react.model.json in the cq-spa-page-model-manager forces the credentials to be sent with the request.

Level 3
November 4, 2018

Are you able to resolve this issue . Because am facing the same problem in 6.4 . Please help me here