BTW I glanced over the whole login thing but really login is authentication
which is going to require you hit the server to validate the user. There are
a lot of good resources on the web which you can google that will show how
to do this using a servlet and request session id. What is critical in these
techniques is that you should always include the user's session id (obtained
from the cookie after their first login for instance) in all payloads to the
servlet and compare that to the current session id reported by request's
session object.

Jeff

On Mon, Oct 25, 2010 at 11:26 AM, Jeff Schwartz <[email protected]>wrote:

> Refresh reloads your javascript and runs it from the top so if the first
> thing your app does is display the login in screen then that is what will be
> displayed when the user refreshes the page.
>
> Use history and HistoryListener to control your user's navigation. A common
> patter is the following:
>
>         String initToken = History.getToken();
>         if (initToken.length() == 0) {
>             History.newItem("login");
>         }
>         History.addValueChangeHandler(new MyHistoryListener());
>         History.fireCurrentHistoryState();
>
> Initially your OnModuleLoad method in your entry point should set history
> to "login" or some other token that will direct your user to the login
> "page".
>
> In your HistoryListener you should react to a "login" token by displaying
> the login screen. Once logged in set cookies appropriately.
>
> In your entry point's OnModuleLoad method you can check for cookies and if
> present add a new token such as "next" and handle next in your History
> listener to do what ever the user should see if they are already logged in.
>
> If your user is logged in (cookies exist) and they press refresh they will
> be directed to the correct view because "next" is the current history token.
>
> Jeff
>
>
>
> On Mon, Oct 25, 2010 at 8:17 AM, sam <[email protected]> wrote:
>
>> i created a Gwt prototype,entry point is LOGIN page,once login is
>> success it will direct to the home page.The
>> problem is after login successfully if i click on the "refresh button
>> of the Browser its directing to the login page".so that i have to
>> enter the login details again.
>>
>> please suggest me to avoid this problem.
>>
>> --
>> 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]<google-web-toolkit%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>>
>
>
> --
> Jeff
>



-- 
Jeff

-- 
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.

Reply via email to