Http request returns 403 only the first time only on device

I implemented an app with Ionic. This app makes https requests to my server app that is done with Java8 and Spring Boot. In the browser everything works well but when I launch the app on my phone every request gets rejected with 403 Forbidden status only the first time. The same request succeeds the second time. For example: When I try to login with username and password, I press login and I get 403 Forbidden. I press it again, without changing anything and it succeeds. This behaviour is the same for all the requests that I make. What can be the problem? I don’t even know where to begin.
I already asked on stackoverflow, this is the link to that: http://stackoverflow.com/questions/40436821/https-requests-from-ionic-app-returns-403-first-time-then-it-works