import flask
import os.path
import datetime
import urllib.parse
from .. import database
from .. import configmanager
from . import controllers

FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static"))
CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../configs/"))

configs = configmanager.ConfigManager(configPath = CONFIG_PATH)
authConfig = configs["auth"]

app = flask.Flask(__name__, static_folder = STATIC_PATH)
app.secret_key = authConfig["signing_key"]
app.register_blueprint(controllers.user.blueprint)
app.register_blueprint(controllers.admin.blueprint)

@app.teardown_request
def teardown_request(exception = None):
	print(flask.session)
	databaseConnection = database.ConnectionManager.getMainConnection()
	databaseConnection.session.close()

import flask
import os.path
import datetime
import urllib.parse
from .. import database
from .. import configmanager
from . import controllers

FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static"))
CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../configs/"))

configs = configmanager.ConfigManager(configPath = CONFIG_PATH)
authConfig = configs["auth"]

app = flask.Flask(__name__, static_folder = STATIC_PATH)
app.secret_key = authConfig["signing_key"]
app.register_blueprint(controllers.user.blueprint)
app.register_blueprint(controllers.admin.blueprint)

@app.teardown_request
def teardown_request(exception = None):
	databaseConnection = database.ConnectionManager.getMainConnection()
	databaseConnection.session.close()

Remove session cookie print in teardown
Remove session cookie print in teardown

  import flask
  import os.path
  import datetime
  import urllib.parse
  from .. import database
  from .. import configmanager
  from . import controllers
  
  FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
  STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static"))
  CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../configs/"))
  
  configs = configmanager.ConfigManager(configPath = CONFIG_PATH)
  authConfig = configs["auth"]
  
  app = flask.Flask(__name__, static_folder = STATIC_PATH)
  app.secret_key = authConfig["signing_key"]
  app.register_blueprint(controllers.user.blueprint)
  app.register_blueprint(controllers.admin.blueprint)
  
  @app.teardown_request
  def teardown_request(exception = None):
- 	print(flask.session)
  	databaseConnection = database.ConnectionManager.getMainConnection()
  	databaseConnection.session.close()
  
Remove session cookie print in teardown
## Code Before:
import flask
import os.path
import datetime
import urllib.parse
from .. import database
from .. import configmanager
from . import controllers

FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static"))
CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../configs/"))

configs = configmanager.ConfigManager(configPath = CONFIG_PATH)
authConfig = configs["auth"]

app = flask.Flask(__name__, static_folder = STATIC_PATH)
app.secret_key = authConfig["signing_key"]
app.register_blueprint(controllers.user.blueprint)
app.register_blueprint(controllers.admin.blueprint)

@app.teardown_request
def teardown_request(exception = None):
	print(flask.session)
	databaseConnection = database.ConnectionManager.getMainConnection()
	databaseConnection.session.close()

## Instruction:
Remove session cookie print in teardown
## Code After:
import flask
import os.path
import datetime
import urllib.parse
from .. import database
from .. import configmanager
from . import controllers

FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
STATIC_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../static"))
CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../configs/"))

configs = configmanager.ConfigManager(configPath = CONFIG_PATH)
authConfig = configs["auth"]

app = flask.Flask(__name__, static_folder = STATIC_PATH)
app.secret_key = authConfig["signing_key"]
app.register_blueprint(controllers.user.blueprint)
app.register_blueprint(controllers.admin.blueprint)

@app.teardown_request
def teardown_request(exception = None):
	databaseConnection = database.ConnectionManager.getMainConnection()
	databaseConnection.session.close()
