I'm working on Angular-5 and Spring framework. In spring framework we are making webservices using RESTEG and in Angular. I'm calling webservices from Angular-5 services.
Now problem is angular is working on 4200. And Tomcat is working on 8080 port. So, server side session in spring is not generating when I'm calling it through webservices.
Webservices works fine I'm able to call webservices and get response from webservices. But I'm not able to generate session which is generated on Back-End.
I have tried with proxy server also of Angular-5 and proxy works fine. For Proxy setup I'm using this question and it works fine :- angular-cli server - how to proxy API requests to another server?
I'm able to get request and response from it but after creating proxy I have the same issue that session is not creating.
Note :- When I made a build from angular-5 (ng build) and Put it in Tomcat then session works fine but while developing the webservices. I'm not able to generate session.
Example :- I have a webservice,
Url1 :- http://localhost:8080/MacromWeb/ws/login
And I'm calling webservices from angular js which is on port 4200
.
Url2 :- http://localhost:4200/#/login
with parameter email
and password
.
So, when I'm calling webservices from angular it works fine it gives me response as well but the session which is created on server side is not generating.