1

Grails and android App - For each request (get or post) that I send from an same android app in succession, the session id that i get in a grails controller is different. I expect the session to be the same.

Grails and Web - if I run the similar request from web browser the session id in the controller remains the same.

Why the session id could be changing, when I call request from an android app to grails server?

Zombo
  • 1
  • 62
  • 391
  • 407

1 Answers1

0

Since your api works from the web browser, which is not using ajax. And your Android app is not working. Then it's likely that your browser is NOT using the rest api and your app is. Rest is by default and by implication stateless so it makes sense it's not working from Android. In short: when working properly rest shouldn't be using session ids.

The most common solution is to maintain the state in the client side and transfer it over to the server with each request. You can read more about this here.

On the Grails side, you can just ensure you've got an appropriate rest implementation, as described here.

Community
  • 1
  • 1
Emmanuel Rosa
  • 9,697
  • 2
  • 14
  • 20