title: How to prevent update of session expiration time for specific URL
body: <p><strong>Flask Version:</strong></p>
  
  <pre><code>&gt;&gt;&gt; flask.__version__
  '0.12.2'
  </code></pre>
  
  <p>I don't want to update the expiration time for a certain URL.<br>
  Currently, I use the following method for setting session expiration time:</p>
  
  <pre><code>session.permanent = true
  app.permanent_session_lifetime = timedelta(minutes=int(10))
  </code></pre>
  
  <p>I have a status page which auto-refreshes every minute using an ajax method to get only the data.<br>
  I don't want to reset the session expiration time in this case.<br>
  Is there any way to do so?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p><strong>My Code so far:</strong></p>
  
  <pre><code>from datetime import timedelta
  from flask import Flask
  from flask import session
  
  APP = Flask(__name__, static_url_path='', static_folder='templates')
  
  def create_user_session(user_accountid, auth_token):
      session['token'] = auth_token
      session['user_accountid'] = user_accountid
  
  def update_session():
      session.permanent = True
      APP.permanent_session_lifetime = timedelta(minutes=10)
      session.modified = True
  
  @APP.route('/batch_status', methods=['GET'])
  def view_status():
      create_user_session(1, "****")
      update_session()
      return "Session Change"
  
  @APP.route('/batch_status_json', methods=['GET'])
  def retrieve_status():
      return "Session No Change"
  
  if __name__ == '__main__':
      APP.secret_key = "My Precious Key"
      APP.run(host='0.0.0.0', debug=True, port=8000)
  </code></pre>
  
  <p>I don't want to change the session expiration time on <code>batch_status_json</code> call but it automatically changes when called.</p>
  
  <p><strong>Edit2:</strong></p>
  
  <p><strong>monitor_controller.py:</strong></p>
  
  <pre><code>from datetime import timedelta
  from flask import Flask
  from flask import session
  from status import RETRIEVE_STATUS
  
  APP = Flask(__name__, static_url_path='', static_folder='templates')
  
  APP.register_blueprint(RETRIEVE_STATUS)
  def create_user_session(user_accountid, auth_token):
      session['token'] = auth_token
      session['user_accountid'] = user_accountid
  
  def update_session():
      session.permanent = True
      APP.permanent_session_lifetime = timedelta(minutes=10)
      session.modified = True
  
  @APP.route('/batch_status', methods=['GET'])
  def view_status():
      create_user_session(1, "****")
      update_session()
      return "Session Change"
  
  if __name__ == '__main__':
      APP.secret_key = "My Precious Key"
      APP.run(host='0.0.0.0', debug=True, port=8000)
  </code></pre>
  
  <p><strong>status.py:</strong></p>
  
  <pre><code>from flask import Blueprint
  
  RETRIEVE_STATUS = Blueprint('retrieve_status', __name__)
  @RETRIEVE_STATUS.route('/batch_status_json', methods=['GET'])
  def retrieve_status():
      return "Session No Change"
  </code></pre>