Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Specner Fontein
Specner Fontein
425 Points

Stop User From Going Back To Being Logged In Web Browser

Hi Everyone,

I am making a web app and when a user logs out and is taken to the login page, I want to stop them from being able to go back to the previous page (the logged in page) as they just logged out and this would be a security issue? I was wondering who I could do this in JavaScript? I would like it ideally to just reload the current page they are on the first time they hit it and then if they hit it a second time go to the last page where they weren't logged in. Or if thats not possible then to do what the standard practice is?