please tell me how to do the registration and authorization. On the site if you do it 's all clear , there is a simple connection to the database . But here's the first application that comes to mind is to make a site that will send the registration and the registration page to post a request with the login and password. The second option unsafe , make a connection to the database directly. It is also unclear to me how to make the user after login was always logged as presses the exit. Then I think you need to write a cookie file, for example plist. Explain please. If there are examples of this will be very cool!