0
  1. derby new TestDerby

  2. Uncomment server/index.js

  3. add console.log(model.get(),model.session) to app/index.js - this.start

  4. model.session is undefined

    (had a quick look at racer/lib/session/session.Store.js)

or derby recommend to use model.set('_session-item-key',value) instead of session?

Community
  • 1
  • 1
atian25
  • 4,166
  • 8
  • 37
  • 60
  • it seems that the model.session only exist at server, so if I want to access session at a client route, what should I do instead of using session. – atian25 Aug 09 '12 at 15:28

1 Answers1

1

You have access to session via model.session. Write a custom middleware to hook into the creation of your expressApp: model = req.getModel(); model.set('_whatever', model.session.whatever); Example custom middleware, example model.session

lefnire
  • 2,524
  • 2
  • 26
  • 36