在 RESTful Web 服务中实现注销 [英] Implementing logout in a RESTful webservice

查看:46
本文介绍了在 RESTful Web 服务中实现注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要注销服务的移动应用程序.登录服务是通过从数据库验证来完成的,现在我被困在注销.

I am developing a mobile application which a logout service is required. The login service is done by validating from database, and now I am stuck at logout.

推荐答案

您将需要两个 Web 服务,一个用于登录,一个用于注销.在用户退出应用时,需要调用退出服务.

You will be needing two web services, one for logging in and one for logging out. At the time when the user is logging out of the app, you need to call the log out service.

详细来说,您必须在数据库中管理一个标志.当通过登录 Web 服务传递正确的用户名和密码时,该标志将为真.在注销服务上,您只需要发送用户名并将标志更新为 false.通过这种方式,如果您将移动设备的 IMEI 号码与用户名和密码一起发送到登录服务,您还可以防止多次登录.

In detail, you have to manage a flag in the database. That flag will be true when the correct username and password are passed through the login web service. And on the logout service you just need to send the username and update the flag as false. In this way you can also prevent multiple logins if you send the IMEI number of the mobile device to the login service along with the username and password.

这篇关于在 RESTful Web 服务中实现注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆