Relative Content

Tag Archive for djangohttpnext.jscookieshttprequest

Sending GET request from front-end app to the back-end app does not contain cookies ( front nextJS + back Django )

So basically from what I read across the internet, Django cookies are stored in the sessions I guess, and when we try to access them what so ever, there will be sessionid in the cookies and it makes the cookies (like accessing the user stored in the request and stuff) achievable. My problem is that I have a front-end, and in that I try to get the data of a ‘Post’. The problem is that in my GET request, from what I invested, there are no cookies sent to the back-end, and because of that, the sessionid is gone and my user that is stored (or better to say must be stored) in the request is gone (AnonymousUser it is). The fun fact is there is another view in my Django app for logout, which works prefect and the request does have the sessionid and access to the user in the request. My question is, is this a problem with my views ?! Is it general ?! What is causing this to happen ?! I really need this to be fixed, cause all my project is actually getting collapsed because of this problem I have with fetching data.
How do I send request to get the data of ‘Post’: