"I'm using the ngx-cookie-service library in my Angular application, but I'm getting two different cookies on every login as already the session id has been SET in the backend, to GET the correct cookie value, How can I ensure that my Angular application GET the correct cookie value using the ngx-cookie-service library (Session id and cookie is set in the backend)
I have installed Ngx cookie service and tried to SET and GET the cookie from frontend but i'm getting two different cookies on every login as already the session id has been SET in the backend (So i need help on how to GET session id and cookie to be captured from frontend)
If you are using the ngx-cookie-service library in your Angular application and you want to ensure that you're retrieving the correct session ID cookie value that has been set on the backend, you can follow these steps:
Set the Cookie on the Backend: Ensure that your backend is correctly setting the session ID cookie. Make sure that the cookie name matches the one you're trying to retrieve on the frontend.
Install and Import Ngx Cookie Service: Make sure you have the ngx-cookie-service library installed in your Angular project. You can install it using the following command:
Import the CookieService in the component or service where you want to retrieve the cookie value:
Make sure to replace 'session_id' with the actual name of your session ID cookie.
By using the ngx-cookie-service library's get() method, you should be able to retrieve the correct session ID cookie value that was set on the backend. Double-check that the cookie name matches exactly between the backend and frontend, as any discrepancies could result in not being able to retrieve the correct value. Also, ensure that your backend is properly setting the cookie's domain and path to make it accessible to your frontend application.