Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. /**
  2. * Session Configuration
  3. * (sails.config.session)
  4. *
  5. * Sails session integration leans heavily on the great work already done by
  6. * Express, but also unifies Socket.io with the Connect session store. It uses
  7. * Connect's cookie parser to normalize configuration differences between Express
  8. * and Socket.io and hooks into Sails' middleware interpreter to allow you to access
  9. * and auto-save to `req.session` with Socket.io the same way you would with Express.
  10. *
  11. * For more information on configuring the session, check out:
  12. * http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.session.html
  13. */
  14.  
  15. module.exports.session = {
  16.  
  17. /***************************************************************************
  18. * *
  19. * Session secret is automatically generated when your new app is created *
  20. * Replace at your own risk in production-- you will invalidate the cookies *
  21. * of your users, forcing them to log in again. *
  22. * *
  23. ***************************************************************************/
  24. secret: '96e02104d18b6b9286227bbe43145384',
  25.  
  26.  
  27. /***************************************************************************
  28. * *
  29. * Set the session cookie expire time The maxAge is set by milliseconds, *
  30. * the example below is for 24 hours *
  31. * *
  32. ***************************************************************************/
  33.  
  34. cookie: {
  35. maxAge: 24 * 60 * 60 * 1000
  36. },
  37.  
  38. /***************************************************************************
  39. * *
  40. * Uncomment the following lines to set up a Redis session store that can *
  41. * be shared across multiple Sails.js servers. *
  42. * *
  43. * Requires connect-redis (https://www.npmjs.com/package/connect-redis) *
  44. * *
  45. ***************************************************************************/
  46.  
  47. adapter: 'connect-redis',
  48.  
  49. /***************************************************************************
  50. * *
  51. * The following values are optional, if no options are set a redis *
  52. * instance running on localhost is expected. Read more about options at: *
  53. * *
  54. * https://github.com/visionmedia/connect-redis *
  55. * *
  56. ***************************************************************************/
  57.  
  58. host: 'localhost',
  59. // port: 6379,
  60. // ttl: <redis session TTL in seconds>,
  61. // db: 0,
  62. // pass: <redis auth password>,
  63. // prefix: 'sess:',
  64.  
  65.  
  66. /***************************************************************************
  67. * *
  68. * Uncomment the following lines to set up a MongoDB session store that can *
  69. * be shared across multiple Sails.js servers. *
  70. * *
  71. * Requires connect-mongo (https://www.npmjs.com/package/connect-mongo) *
  72. * Use version 0.8.2 with Node version <= 0.12 *
  73. * Use the latest version with Node >= 4.0 *
  74. * *
  75. ***************************************************************************/
  76.  
  77. // adapter: 'mongo',
  78. // url: 'mongodb://user:password@localhost:27017/dbname', // user, password and port optional
  79.  
  80. /***************************************************************************
  81. * *
  82. * Optional Values: *
  83. * *
  84. * See https://github.com/kcbanner/connect-mongo for more *
  85. * information about connect-mongo options. *
  86. * *
  87. * See http://bit.ly/mongooptions for more information about options *
  88. * available in `mongoOptions` *
  89. * *
  90. ***************************************************************************/
  91.  
  92. // collection: 'sessions',
  93. // stringify: true,
  94. // mongoOptions: {
  95. // server: {
  96. // ssl: true
  97. // }
  98. // }
  99.  
  100. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement