Where should you manage a users session in a SOA? Should you manage it in the Web Service or in the client and why?

My application is SPA (Considering that this will be the stacked that will be used Apache CXF for Web Services AngularJS for making REST calls)

2 Answers 2


I think session should be managed of Client side as far as possible in SPAs.In SOA , Mostly service are viewed as stateless and puting state logic inside it will be deviation. Servies ae meant to perform the task without botherig about sessions. However maintaing session on client side increasese the complexity a lot.

  • Well. If service exposes some REST API, then it should be able to somehow distinguish users and perform authorization...
    – kravemir
    Sep 15, 2017 at 17:36
  • How can the app store the session data. By Database?
    – Ben Cheng
    Aug 7, 2018 at 8:15
  • One way to maintaining session at client side could be browser storage(browser's local storage or session storage) which are urls based.
    – sapan
    Aug 9, 2018 at 8:19

Session should be managed at client side, as services mainly for server side processing and not for maintaining user session. But if we are managing user session at client side we need take care of security pitfall at client side, as user data is prone to get changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.