title: Flask - Call a route and the go back to the first route
body: <p>In my app, I have a route called /main.  I also have a route called /index which checks to see if a session token has expired.  If it has, it calls /login.  If not, it goes back to /main.</p>
  
  <p>This is so that if someone refreshes /main then it will check their session status first.</p>
  
  <p>What I'd like to do at the start of /main is call /index.  Then, at the end of /index go back to /main and continue from where it left off rather than starting the route again.</p>
  
  <p>So, something like:</p>
  
  <pre><code>@app.route('/main')
     return redirect(url_for('index'))
     #Do the /main stuff
  
  @app.route('index')
     #Do some stuff
     return redirect(url_for('main')) #But don't go back to the start, go back to doing the /main stuff
  </code></pre>
  
  <p>Obviously, this will just get me into an endless loop.  Could someone suggest the proper method to achieve this.</p>