title: the session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret. Flask/Heroku
body: <p>The flask app can login and register all fine on localhost. But this becomes an issue when i push it to heroku. It shows the above mentioned error. Here's the app.py code</p>
  
  <pre><code>from flask import Flask, render_template, request, redirect, jsonify, url_for, flash
  from sqlalchemy import create_engine, asc, desc
  from sqlalchemy.orm import sessionmaker
  from database_setup import Base, User, BlogPost
  from flask import session as login_session
  import random
  import string
  from wtforms import Form, BooleanField, TextField, PasswordField, validators
  from passlib.hash import sha256_crypt
  
  
  app = Flask(__name__)
  
  
  #Connecting to database
  engine = create_engine('sqlite:///travellerdata.db')
  Base.metadata.bind = engine
  
  DBSession = sessionmaker(bind=engine)
  session = DBSession()
  </code></pre>
  
  <p>And ends with...</p>
  
  <pre><code>if __name__ == "__main__":
      app.secret_key = 'some secret key'
      app.debug = True
      app.run()
  </code></pre>