app 登录 、注册 与 web 端的登录注册 问题

WBOY
Release: 2016-06-06 20:43:15
Original
1661 people have browsed it

想问一下,如何实现在app的登录、注册,推荐的方式是什么。如何保持登录状态,确定过期时间。
web端也要登录,注册,如果保持app和web的状态共享。

回复内容:

想问一下,如何实现在app的登录、注册,推荐的方式是什么。如何保持登录状态,确定过期时间。
web端也要登录,注册,如果保持app和web的状态共享。

建议后端实现统一的注册、登录接口,比如流行的 RESTFull API的形式。web 和 app的登录只需要调用该接口,既复用了代码,也做到了解耦。
状态共享可以通过任意一个端登录的时候,同步其他端的登录信息

每次请求的时候head里面加上登录时获取的Token就行啦

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!