In a php web application we can check if user is logged in or not by using sessions , my android app will use volley to call php api which will send a json response from remote web server , if user get their profile or update something it will call userdetail.php
, how server will know it is a authenticated request or not ? or else I need to send username and password along with all api calls , Is this a correct way ? or is there any other ways available to do the same ?
当使用php web服务开发和android应用程序如何验证而不是php会话?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- douyi2107 2019-02-01 10:17关注
The way I had implemented this is when login hit a API and update a token field in the user table and send it back with response and user details.
Every time the user hit an API , check the token along with the email or username whichever is unique and send back the result.
Note - the token column only changes after the login not after that.
解决 无用评论 打赏 举报
悬赏问题
- ¥15 求daily translation(DT)偏差订正方法的代码
- ¥15 js调用html页面需要隐藏某个按钮
- ¥15 ads仿真结果在圆图上是怎么读数的
- ¥20 Cotex M3的调试和程序执行方式是什么样的?
- ¥20 java项目连接sqlserver时报ssl相关错误
- ¥15 一道python难题3
- ¥15 牛顿斯科特系数表表示
- ¥15 arduino 步进电机
- ¥20 程序进入HardFault_Handler
- ¥15 关于#python#的问题:自动化测试