Skip to content

Commit

Permalink
add torndsession srcé
Browse files Browse the repository at this point in the history
  • Loading branch information
echarles committed Jul 24, 2021
1 parent 880dc02 commit 3f18378
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions jupyter_server/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from jupyter_server.utils import ensure_async, url_path_join, url_is_absolute, url_escape, urldecode_unix_socket_path
from jupyter_server.services.security import csp_report_uri

from torndsession.session import SessionMixin
from ..torndsession.session import SessionMixin

#-----------------------------------------------------------------------------
# Top-level handlers
Expand Down Expand Up @@ -91,16 +91,16 @@ def set_default_headers(self):
self.log.debug(e)

def get_session_id(self):
return self.session.id
return self.web_session.id

def get_session(self):
return self.session
return self.web_session

def get_sessions(self):
return self.session.driver._data_handler
return self.web_session.driver._data_handler

def get_sessions_count(self):
return len(self.session.driver._data_handler)
return len(self.web_session.driver._data_handler)

def force_clear_cookie(self, name, path="/", domain=None):
"""Deletes the cookie with the given name.
Expand Down
11 changes: 9 additions & 2 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,15 @@ def init_settings(self, jupyter_app, kernel_manager, contents_manager,
allow_password_change=jupyter_app.allow_password_change,
server_root_dir=root_dir,
jinja2_env=env,
terminals_available=terminado_available and jupyter_app.terminals_enabled,
serverapp=jupyter_app
terminals_available=False, # Set later if terminals are available
serverapp=jupyter_app,
session_settings = dict(
driver='memory',
driver_settings={'host': self},
force_persistence=True,
sid_name='torndsessionID',
session_lifetime=1800
),
)

# allow custom overrides for the tornado web app.
Expand Down

0 comments on commit 3f18378

Please sign in to comment.