Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
browser refresh reloads the login page
I am having Login authentication in my application , once the login succeeds we re-set the contents of the Window.
On Chrome when i do a refresh (click on the browser refresh button ) after login , the application goes back to the login page.
But on Firefox on refresh , it just refreshes the window contents and does not go back to login.
Obviously we don't want the user to re-login on refresh.
Has anyone else encountered this issue on chrome & knows how to address this ?
Any help is appreciated.
-Anurag
Solution In my case set the following in the context.xml
<Context sessionCookiePathUsesTrailingSlash='false'>
Hi,
I have the same problem. I think this is because the application is restarted on Chrome, as Firefox do when adding ?restartApplication parameter in the URL. This also happens in Opera browser. Anyway, I don't know how to solve it neither.
Which Vaadin version, Firefox version, Opera version?
Can you reproduce it in different applications? In a simplified version of your application or in a trivial test application?
Same here with Vaadin 6.8.0:
Chrome 20: restart
Opera 11.62: restart
Safari 5.1.7: restart
IE 9: restart
FF 13: ok
I tested it with the 2 apps I made so far with Vaadin: only one has this behaviour! I have to find out what the differences are. Maybe Henri has an idea where I should take a deeper look?
Regards
Andreas
EDIT: [QUESTION SOLVED] The example works as expected. Now I have to extrapolate this results to my application, I think my error is in my loginform. I use the LoginListener instead of constructing my own login box so I couldn't implement my ButtonClickListener as the example shows.
---
I'm trying to implement a very simple app for testing this problem based on this example: Authenticating Vaadin based applications but using HttpServletRequestListener instead of TransactionListener as in ThreadLocal Pattern , but I don't know where I should set the MianWindow.
Should be something like this?:
public class SmaappApplication extends Application implements HttpServletRequestListener{
private static ThreadLocal<SmaappApplication> currentApplication = new ThreadLocal<SmaappApplication> ();
public void init (){
setInstance(this);
setMainWindow(new SMSWindow());
}
// @return the current application instance
public static SmaappApplication getInstance() {
return currentApplication.get();
}
// Set the current application instance
public static void setInstance(SmaappApplication application) {
currentApplication.set(application);
}
public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {
SmaappApplication.setInstance(this);
}
public void onRequestEnd(HttpServletRequest request, HttpServletResponse response) {
currentApplication.remove();
}
}
Sorry for my question, I'm very beginner!!
Thanks in advance.
--
Check if the following works , in my case once i set the following in the context.xml
<Context sessionCookiePathUsesTrailingSlash='false'>
The issue was not seen
Hi Anurag,
<Context sessionCookiePathUsesTrailingSlash='false'>
that did the trick for me! Thanks a lot!
Andreas