mvc - how to avoid log out when refresh a page - ajax

I have built the MVC application with WCF service. The major problem I have experienced with refreshing page.
I have created a login page with session (username and password). But when you refresh the home page by pressing F5, it would automatically log out.
That is my problem. I need to stay the home page after refresh. I have been googling around to find a solution but it seems not helpful.
Any idea? Your advise or code example much appreciated.

Related

Navigating to a page causes the app to gets stuck in the current page and exits debug mode automatically

I am working on the Xamarin iOS application and navigating to the login page that is when my app gets stuck in the current page ie the page where i am navigating from.
The debug point don't come to Initialise component of Login page nor it gets logged in catch the app gets stuck for a while and exits debug mode without any errors or exception
This navigation is basic, other pages are being navigated only issue is with the login page.
Also please let me know what parts of code should i Share
Please let me know if there is any solution.
I made a new page and copied all the contents of Login page to the new page and it worked, the underlying issue was the Login Page was corrupted when transferring from Windows To Mac,
As per why i think it was corrupted, because the debug point at Initialize component and onAppearing didn't work at all

Very weird glitch with twitter bootstrap and glyphicons and Spring web app

I'm using twitter bootstrap for the design of my web app. I'm using Spring boot, Spring MVC, and Spring Security for the backend. I'm also using thymeleaf for the view. I have glyphicons on my home page and they don't show up when I first open my app, it just shows an empty box with a border, where they glyphicons are supposed to be. When I log in to my app, and only when I log in and it redirects me to the home page, the screen just shows a list of glyphicons and the url points to http://localhost:8080/fonts/glyphicons-halflings-regular.ttf, and then when I manually type in the url to send me to the home page the glyphicons show up. I have no idea why this could be happening and I don't know why logging in causes something to happen to the glyphicons, I would think they would be unrelated events. If anyone has any ideas as to why this could be happening, and could let me know that would be super helpful, thanks in advance.
Could it be that this resource is only accessible once you are authenticated?
If that is the case you might load an empty response (or a failed attempt) during the login screen and once the ttf is loaded it's taken from the browser cache, which is still empty.

WebSphere Portal Page Passing Parameters On Page Link Click

I am using WebSphere Portal 8 and I am facing one issue related to session clearing on Portal Page link click. I have a portal page with one single portlet (Search Portlet) and it is working fine. Then after some search I navigate to another unrelated page and again click on the link to Search Portlet. The problem is previously selected values are still present in UI.
I want to know is there any way I will know which Page Link is clicked so that I can clear session in Portlet Class. Or is there anyway to pass some parameters once a Page Link is clicked.
Thanks in Advance!
Pradeep
Portal maintains the state of the portlet, redirecting to page with clean URL will do the trick.

Why page_load is called twice in my web application?

I have already gone through some of the posts in many websites regarding page_load being called twice but my problem is little bit different from those.
My problem is with the landing page of my web application.
Initially in my website page_load for the landing page was getting called twice every time when it is loaded. Since my application is an upgraded one (from VS 2003 to VS 2005/2008), I commented the "this.load" event in InitializeComponent. Now it works fine, when user first logs in, into my web application. But then, whenever user navigates to this page from any other page in my application, page_load gets called twice.
Does anybody have any idea about why this could be happening. I tried to track the call stack for this, but VS 2008 was showing that this was getting called from external code.
Also, I am using frames in my web application. I wonder if this problem has anything to do with frames.
Any help is deeply appreciated.
Regards,
Hari

Web page expired message in browser

I am implementing a web application using ASP .Net and C#. One of the pages has a requirement that it always needs to be fetched from the server, rather than from the local browser cache. I have been able to achieve this.
We have a back button in the application, which simply invokes javascript:history.back() method. The problem is that when the back button is clicked to navigate to the page which is always to be reloaded from the server, the browser displays a "Web page expired message".
The intent here is to force the browser to reload the page rather than display the web page expired message.
Any help would be highly appreciated. Thanks a ton in advance.
You will probably need to change the implementation to make the browser load the URL explicitly:
window.location.href = 'http://....';
instead of invoking the back button, since the intention of the back button is to get the last page from the cache.
(If browsers would not act that way, they would re-send your form data multiple times when using the back button during a registration process or similar.)
You mean you want to control browser behaviour, which is not possible. I doubt you can solve it that way. You could set the expiration time to a small value (1 minute perhaps?) so that the page is still valid if one navigates back quickly.

Resources