cubicweb/pyramid/session.py
changeset 12243 a46fb3f58ea2
parent 12225 a8ed10f80a85
child 12278 77a543e7878a
equal deleted inserted replaced
12242:68ca7fe0ca29 12243:a46fb3f58ea2
   253     settings = config.registry.settings
   253     settings = config.registry.settings
   254     try:
   254     try:
   255         secret = settings['cubicweb.session.secret']
   255         secret = settings['cubicweb.session.secret']
   256     except KeyError:
   256     except KeyError:
   257         secret = 'notsosecret'
   257         secret = 'notsosecret'
   258         warnings.warn('''
   258         if config.registry['cubicweb.config'].mode != 'test':
   259 
   259             warnings.warn('''
   260             !! WARNING !! !! WARNING !!
   260 
   261 
   261                 !! WARNING !! !! WARNING !!
   262             The session cookies are signed with a static secret key.
   262 
   263             To put your own secret key, edit your pyramid.ini file
   263                 The session cookies are signed with a static secret key.
   264             and set the 'cubicweb.session.secret' key.
   264                 To put your own secret key, edit your pyramid.ini file
   265 
   265                 and set the 'cubicweb.session.secret' key.
   266             YOU SHOULD STOP THIS INSTANCE unless your really know what you
   266 
   267             are doing !!
   267                 YOU SHOULD STOP THIS INSTANCE unless your really know what you
   268 
   268                 are doing !!
   269         ''')
   269 
       
   270             ''')
   270     session_factory = CWSessionFactory(secret)
   271     session_factory = CWSessionFactory(secret)
   271     config.set_session_factory(session_factory)
   272     config.set_session_factory(session_factory)