View Full Version : Logout issues

31 Aug 2010, 9:18 AM
Here is something I am finding it hard to figure out.

My app has some resources for example, the app specific js files are located in the js folder. Access to those requires user to be logged in (i.e. authenticated). That works fine.

Now, after logging in, my app loads, all the files, js, html load and it goes fine. Coool. Now, when I click logout, it takes me to the login.html page as expected.

1. However, it seems the browser still cached some pages. So for example, after logging out, I can go to myApp/js/temp.html page. It brings up that page, which shouldn't be the case since user has already logged out.

2. The access to other resources say for example, POST, GET and PUT is still restricted. That work as expected when user logs out. i.e. if the user clicks on a link on the page loaded in scenario #1(above), it issues for example
GET http://localhost:8080/myApp/contacts/

Now, since user has already logged out, the response is -
302 Moved temporarily
and immediately/automatically GET http://localhost:8080/myApp/login.html is issued.

So the server side logic works fine. But how do I instruct my Ajax request that did the GET http://localhost:8080/myApp/contacts/ to redirect to login.html ? or better understand the code of the response was 302 etc.