angular.js - angularjs登录之后如何安全的利用cookie实现用户的权限控制
巴扎黑
巴扎黑 2017-05-15 16:54:55
0
2
572

需求:前后端彻底分离的项目,只通过API交互,用户登录成功后,后端将用户的name和权限写入cookie,前端根据cookie来给不同用户不同的权限

思考:将权限写入cookie很简单,但是这样如何保证安全?

巴扎黑
巴扎黑

reply all(2)
Peter_Zhu

Applications written in angularjs must verify user permissions on both the front and back ends. Because angularjs is a single-page application, all codes are on the front end, and users can modify them at will. Please refer to: https://blog.coding.net/blog/techniques- for-authentication-in-angular-js-applications

阿神

Put a SessionID in the cookie, and put other user and permission-related data in the cookie. Users can basically log in without entering their username and password.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template