Session design of an Application server API with multiple client platforms
<p>I'd like to build an app that'll support multiple platforms: Desktop applications (Mac/PC), Web (angularJS fronted) and native mobile apps.</p>

<p>So I'm thinking of an application server, serving internal APIs to the platforms above. I have certain assumptions regarding how login/logouts are to be supported. I would be happy if anyone could comment if my thinking is wrong.</p>

<ol>
<li>For desktop and mobile apps, the "login" function will use the internal API to communicate the credentials and in return will receive a permanent token. the desktop/mobile app will store the token and use it with any subsequent request to the application server. Upon "logout" from the desktop/mobile app, the token will be discarded on the server side an forgotten on the front end app side.</li>
<li>For the web interface, the angular application will retain the token provided after login as a cookie and will load it up and use it with any request made to the application server.</li>
</ol>

<p>Is this a common pattern? </p>