V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
coolicer
V2EX  ›  Node.js

Nodejs发开时,你使用什么插件管理session?

  •  
  •   coolicer · 2013-08-30 09:28:23 +08:00 · 5315 次点击
    这是一个创建于 3885 天前的主题,其中的信息可能已经有所发展或是发生改变。
    之前在网上看,有一个叫connect-flash的中间件,有没有比较个更好的?目前我使用express原生提供的session,我把session保存到了mongo,但是由于没有后端开发经验,我不知道怎么去清掉它....
    8 条回复    1970-01-01 08:00:00 +08:00
    xieren58
        1
    xieren58  
       2013-08-30 10:17:34 +08:00
    connect-mongo
    GordianZ
        2
    GordianZ  
    MOD
       2013-08-30 10:39:26 +08:00   ❤️ 1
    connect-flash 不是用来管理 session 的啊,亲……
    用楼上说的 connect-mongo, 或者仔细看一下 connect/express 的 session store.
    Ps, 我用的 connect-redis.
    coolicer
        3
    coolicer  
    OP
       2013-08-30 10:55:15 +08:00
    @GordianZ 我不懂,刚写node。

    "session-mongoose":"*",
    "connect":"*"

    我现在用的是这两个东西。
    coolicer
        4
    coolicer  
    OP
       2013-08-30 11:00:39 +08:00
    @GordianZ 请问我怎么实现这个:
    Messages are written to the flash and cleared after being displayed to the user. (这个是flash的介绍)

    我现在是保存在了mongo里,只是不知道怎么清掉它。我怎么实现这个功能?
    GordianZ
        5
    GordianZ  
    MOD
       2013-08-30 11:47:12 +08:00
    @coolicer 如果你使用方法正确的话应该是自动清除的。
    https://github.com/donpark/session-mongoose 照着范例设置。
    lidashuang
        6
    lidashuang  
       2013-08-30 12:29:40 +08:00
    @GordianZ 有redis的吗?
    GordianZ
        7
    GordianZ  
    MOD
       2013-08-30 13:10:08 +08:00
    jayceefun
        8
    jayceefun  
       2013-10-18 13:42:05 +08:00
    试试passport
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5230 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 07:08 · PVG 15:08 · LAX 00:08 · JFK 03:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.