V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
coolicer
V2EX  ›  Node.js

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

  •  
  •   coolicer · Aug 30, 2013 · 6259 views
    This topic created in 4634 days ago, the information mentioned may be changed or developed.
    之前在网上看,有一个叫connect-flash的中间件,有没有比较个更好的?目前我使用express原生提供的session,我把session保存到了mongo,但是由于没有后端开发经验,我不知道怎么去清掉它....
    8 replies    1970-01-01 08:00:00 +08:00
    xieren58
        1
    xieren58  
       Aug 30, 2013
    connect-mongo
    GordianZ
        2
    GordianZ  
       Aug 30, 2013   ❤️ 1
    connect-flash 不是用来管理 session 的啊,亲……
    用楼上说的 connect-mongo, 或者仔细看一下 connect/express 的 session store.
    Ps, 我用的 connect-redis.
    coolicer
        3
    coolicer  
    OP
       Aug 30, 2013
    @GordianZ 我不懂,刚写node。

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

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

    我现在是保存在了mongo里,只是不知道怎么清掉它。我怎么实现这个功能?
    GordianZ
        5
    GordianZ  
       Aug 30, 2013
    @coolicer 如果你使用方法正确的话应该是自动清除的。
    https://github.com/donpark/session-mongoose 照着范例设置。
    G2bN4dbX9J3ncp0r
        6
    G2bN4dbX9J3ncp0r  
       Aug 30, 2013
    @GordianZ 有redis的吗?
    GordianZ
        7
    GordianZ  
       Aug 30, 2013
    jayceefun
        8
    jayceefun  
       Oct 18, 2013
    试试passport
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5502 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 01:25 · PVG 09:25 · LAX 18:25 · JFK 21:25
    ♥ Do have faith in what you're doing.