I have GWT application with file upload Servlet.
GWT application needs to know upload progress and requests it asynchronously using GWT service.

HttpSession object gets created for the first time during the first file upload.
Right after that frontend requests upload status using GWT service, which accesses it using the following code:

```
public class ProgressServiceImpl extends RemoteServiceServlet implements ProgressService {
    private static final long serialVersionUID = 1L;

    @Override
    public List<ProgressChangeEvent> getProgressEvents(String progressName) {
        HttpSession session = getThreadLocalRequest().getSession(false);
        System.out.println("Session in ProgressService: " + String.valueOf(session != null ? session.getId() : null));
        return (session != null) ? Progress.getProgressEvents(session, progressName) : null;
    }
}

```

During entire upload process the session is null.
However, the next time I upload a file the right session is there.

If I call getSession(true), it doesn't help the first time and the next time the first object is just lost, so I believe getSession(false) in this case is the right method to call, however it doesn't sync the session for quite some time.

Is it a bug or is it a desired behavior? If it's doing it by design, how can I work around it to make sure I always have upload status readily available in an asynchronous way?