This might be a common question but I did a few searches and was not satisfied by the answers.
I have a login page which after successful login creates a session variable called 'currentUser'. This variable stores the currently logged in user.
I have other pages that use this variable and show contents based on that user. However, I have found that I can still access that page without logging in using a direct URL access for example: mysite.com/userProfile/
How do I check for the session variable in every view and only allow logged in users to view that page? I tried @login_required and I don't get it.
Thanks,