title: how to keep logged in user in the current page and not to let him go to home from the address bar?
body: <p>I want to keep the logged in user in the current page that he is viewing and not allow him to visit the home page again without loggin out either by pressing the backbutton provided by the browser or form the address bar.
  Is there any decorator that i can use, i tried to write on form a tutorial but i couldn't figure out how to keep the user in the current page. If there is any auto logout method availble please suggest me.</p>
  <p><strong>decorators.py</strong></p>
  <pre><code>def unauthenticated_user(view_func):
      def wrapper_func(request, *args, **kwargs):
          if request.user.is_authenticated:
              return redirect('current_page')
          else:
              return view_func(request, *args, **kwargs)
  
      return wrapper_func
  </code></pre>
  <p><strong>views.py</strong></p>
  <pre><code>@unauthenticated_user
  def index(request):
      return render(request, 'index.html')
  </code></pre>