After a user has registered a new account I want the new user of my site to be logged in automatically, i.e. an automatic login after registration. The registration is a JavaScript application. When the registration form is submitted the first request is a POST request to the registration server which contains the username and password. The response of the registration server is either ok or err. If ok is returned the registration JavaScript triggers a second POST request to the login server which again contains the username and password to login the user.

I have chosen this solution as the registration and login server are running on different domains so that the registration server cannot set a session cookie.

Is there any flaw in this solution?

  • 5
    Why are registration and login running on different domains? Is that a design decision you made, or something you're stuck with? Nov 9, 2016 at 23:35
  • It's a design decision that I cannot change.
    – DanielE
    Nov 16, 2016 at 11:26


You must log in to answer this question.

Browse other questions tagged .