Git Product home page Git Product logo

Comments (2)

ZhangEryi avatar ZhangEryi commented on August 24, 2024

哦 知道了 这个session 只会设置cookie 跨域就搞不定了设置不上

from x-koa.

cheneyweb avatar cheneyweb commented on August 24, 2024

登录认证目前采用了三种方案:
1、本地session,这种方案依赖于cookie和本地主机内存,实现最简单,但是无法解决跨域
2、redis服务,这种方案使用redis维护用户登录信息,全系统通用,可以解决跨域问题
3、json web token,这种方案基于TOKEN口令令牌,无须维护session与token,无须维护与用户连接,只需要关心token过期时间,该方案安全高效稳定,比较适合微服务或Serverless架构,个人推荐
以上三种方案在x-koa项目工程内均有基础实现,可自由选择

from x-koa.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.