on 2021 Nov 13 10:35 PM
Hi,
I'm trying to fetch some data after I did log in and store the Id Session to send it on any request
for example, get items request.
I do not understand how to pass the in the header request the Cookie: B1SESSION=PTRzIjYK-weN6-1Lx1-ZG0J-3ARxfjcU0Shy; ROUTEID=.node1
I have tried some methods and got all kinds of errors
this is my code
getItems(){
let headers = new HttpHeaders();
headers = headers.append('Cookie', 'B1SESSION=' + localStorage.getItem('B1SESSION') + '; ROUTEID=.node3');
console.log(headers);
return this.http.get<Item[]>(this.urlItems, {headers: headers} );
}<br>
What am I doing wrong?
Tomer.
Request clarification before answering.
I found a solution, need to send with all requests this line code { withCredentials: true }
Regards,
Tomer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great to hear to that !!!
1. SQL
2. YES include 'get' items method
3. Yes, still working on it.
I managed to get the SessionId in the login method, but still don't know how to send it with items request
Tomer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's already set like this and still doesn't work
<ifmodule mod_headers.c>
Header edit Set-Cookie ^(.*)$ $1;Secure;SameSite=None
</ifmodule>
I save the response login as cookies like describe in the documentation
Can't find anywhere how to send it or how to send in the http get items request
maybe it will solve the problem
please help!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm using chrome
Without handling the header I get 401 Unauthorized
any more ideas?
Tomer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check the resolution here - Click here
If you're using browser then session id and other details stored in cookies and you don't have send those details in request header, its handled internally.
But if you're using Windows App then you need pass the details separately.
Also the same details you can find it in Service Layer documentation
Just find this link for more information - Click here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
130 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.