coolicer
V2EX  ›  Node.js

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

  •  
  •   coolicer · Aug 30, 2013 · 6800 views
    This topic created in 4829 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
    xieren58
    Aug 30, 2013
    1
    connect-mongo
    GordianZ
    GordianZ
    Aug 30, 2013❤️1
    2
    connect-flash 不是用来管理 session 的啊,亲……
    用楼上说的 connect-mongo, 或者仔细看一下 connect/express 的 session store.
    Ps, 我用的 connect-redis.
    coolicer
    coolicer
    OP
    Aug 30, 2013
    3
    @GordianZ 我不懂,刚写node。

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

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

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