login and logout from another app

I use WP as a CMS which provides content to another webapp my company develops.
The user logins in my webapp with a username and password, such as [Sensitive information is removed by moderator]
I would like that, when the user logins in my webapp, he is automatically logged into WP and can use the WP site as he was logged from the standard WP login form.
I have seen functions wp_create_user and wp_update_user, so I feel comfortable with creating or updating WP users from my app.
I have seen the functions wp_signon, wp_authenticate, wp_getuserinfo, wp_set_auth_cookie, wp_clear_auth_cookie and wp_logout, which looks lile a good starting point for login and logout user.
But i have also seen lots of posts on the web from people who using thes functions but with problems. Some people says for instance that, as soon as the user moves to another page, he is no longer logged.
So which functions do I have to use to login the user exactly as he has logged through the standard WP login form, including the creation of WP cookies?
Thanks in advance for advice or even sample code.