Hi Ashwin, 1) You can store user id in session ( http session ), this is very secure way and a good practice. 2) you can store user id in crypted cookie ( less secure ) 3) you can store user id in javascipt varaible ( more less secure, for intranet only in my opinion)
These solutions (1 & 2) are independant from GWT, it's HTTP protocol specification. See the J2EE API documentation (HttpSession, HttpServletResponse) I hope it helps. regards. Karim Duran 2011/8/9 Ashwin Desikan <[email protected]> > ** > Folks, > > What is the best way to store user information ( i require only the > user-id) in the client? I have to pass user-id along with my queries to the > server to filter responses for the logged-in user. I fetch user-information > using the UserServiceLocator as part of the application login. I am > currently making a gwt-request every time to fetch the currentUser in the > following manner > > requests.userServiceRequest().getCurrentUser().fire(new Receiver<GaeUser>() > { > > @Override > public void onSuccess(GaeUser user) { > userId = user.getEmail(); > userName = user.getNickname(); > } > > }); > > With the above approach, I have to run my subsequent queries to fetch > user-related data onSuccess of the above operation. Is there a better > approach to store the logged-in user-id on the client, instead of making a > server call every time? > > Any suggestions? > > regards > Ashwin > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
