How do I clear cache in my website ?
My problem is:
I have a link to a login page in my home page, as a navigation menu option. After the login had been concluded, when the user return to home page (clicking on logo / banner) and calls the login page again, the system goes to its initial page without make login.
If I close the browser and call the site again, the home page and login page are ignored and the user goes directly to the initial page, bypassing the home page and the login page.
I think it is a cache problem isnt' it?
I had controled this problem using the login as part of home page, but in my case is important to have the login page as another page.
Thanks,
Marco Gantois
How do I clear chache in my website?
- Brian|Dyalog
- Posts: 120
- Joined: Thu Nov 26, 2009 4:02 pm
- Location: West Henrietta, NY
Re: How do I clear chache in my website?
Hi Marco,
The "problem" as you describe it is how browser-based applications work. So, one question might be - what is it about your application that requires that things work differently?
But, if I understand your situation:
Unfortunately, there's no easy solution. If your MiSite uses a single "main" page once the user has logged in, then it's possible to user the document.unload event to detect if the user navigates away from that page, either by closing his browser or going to some other page using something along the lines of:
However, if your MiSite uses multiple pages, things are more complicated because we cannot differentiate how you left the page - it could be because you navigated to another page (either within your application or elsewhere) or closed the browser.
I hope this helps!
/Brian
The "problem" as you describe it is how browser-based applications work. So, one question might be - what is it about your application that requires that things work differently?
But, if I understand your situation:
- You have a home page which is the default page that's loaded when the MiSite is loaded.
- The home page probably checks something in the user's session (in MiServer) to see if he's logged in, and
- if he's not logged in, redirects him to your login page.
- if he is logged in, redirects him to your initial page
- When the user logs in on the login page, you save the fact that he's logged in somewhere in his MiServer session
Unfortunately, there's no easy solution. If your MiSite uses a single "main" page once the user has logged in, then it's possible to user the document.unload event to detect if the user navigates away from that page, either by closing his browser or going to some other page using something along the lines of:
Code: Select all
:Class index : MiPage
∇ Compose;value
:Access public
Add _.h3'Reload and Cookie Test'
:Select value←_Request.GetCookie'testing'
:Case 'not_closed'
Add'page was reloaded - carry on with normal processing'
:Case 'closed'
Add'page was closed - clean up session and redirect to login'
:Else
Add'??? unknown "testing" cookie value : "',value,'"'
:EndSelect
⍝ Add _.Script ScriptFollows
⍝document.cookie="testing=not_closed";
⍝window.onunload = function() {
⍝document.cookie="testing=closed";
⍝};
∇
:EndClass
However, if your MiSite uses multiple pages, things are more complicated because we cannot differentiate how you left the page - it could be because you navigated to another page (either within your application or elsewhere) or closed the browser.
I hope this helps!
/Brian
Re: How do I clear chache in my website?
Hi Brian,
Thank you,
Marco
Thank you,
Marco