How to enable session?

Nov 26, 2013 at 4:23 PM
By default it seems that the req.session variable is set as undefined in any context in the "Blank Express Application" project. How does one go about enabling session?
Coordinator
Nov 26, 2013 at 4:58 PM
Edited Nov 26, 2013 at 4:59 PM
That's an option available from express command line. When you create a new express app using the New Project Dialog, you get the equivalent of:
express -c stylus

I recommend that you create the project using the New Project Dialog, and then overwrite the files using express command line. Once the project is created, click on Open Command Prompt Here in the project node context menu in solution explorer. Run:
express -s -c stylus

(That's assuming you have express installed globally, if not then substitute with .\node_modules\.bin\express)

VS will prompt to reload any files that were opened in the editor.

In a future release, we plan on having the express command line options available in the VS UI: https://nodejstools.codeplex.com/workitem/377
Marked as answer by RickWinter on 9/23/2014 at 10:20 AM