Hello Dmitriy,

You can still set your own cookies with whatever you want value to
identify a customer with WApplication.setCookie(). In a new session,
check for that cookie in the environment object with
WEnvironment.getCookie(). If the cookie is there, you know the user.
Just configure your application server not to use cookies to track
sessions, but you can still use cookies to track users. It works like
that in C++ wt, so I guess it also works like that in JWt ;-)

Best regards,
Wim.


2009/12/18 Dmitriy Igrishin <[email protected]>:
> Hello Koen,
>
> Thanks for you support!
>
> We use Tomcat 6.0.20 now.
> Yes, disabling cookies will solve the problem of desynchronization of the
> application state and the current browser window. However, disabling cookies
> will result in another issue. For example, assume we implement authorization
> of users. When authorized user opens some link in a new browser window, he
> (she) will have to authenticate again because it will be another
> session.This is a very undesirable behavior for our project. We are
> interested in how Vaadin framework solves this problem. In Vaadin, each
> individual browser window can be opened within a single session because the
> events are handled at the window object level, rather than application
> object level.
> Unfortunately, Vaadin does not implement graceful degradation which is also
> undesirable. Moreover, (J)Wt have great class hierarchy and well designed
> (probably because implemented in C++ first :)).
>
> But how we can solve the problem with persistent session across multiple
> browser windows? :)
>
> 2009/12/18 Koen Deforche <[email protected]>
>>
>> Hey Dmitriy,
>>
>> 2009/12/17 Dmitriy Igrishin <[email protected]>:
>> > Hello JWt / Wt community / developers!
>> > We working on a big web project and want to use JWt as the front-end.
>> > After some experience we found bugs:
>> > 1. (Possible Wt-homepage bug, not Wt): incorrect URL handle. Try to
>> > visit http://www.webtoolkit.eu/widgets#/form-widgets/wpopupmenu and you
>> > will
>> > see "Form widgets" page instead of "WPopupMenu WPopupMenuItem";
>>
>> We hadn't noticed this indeed, it seems a regression in WMenu... We
>> will investigate it and fix ASAP.
>>
>> > 2. Bug in WPopUpMenu. Try to click on "Click me and a WPopupMenu will
>> > appear" and click again on it after
>> > pop up menu appears and you'll see "Wt internal error..." message;
>>
>> This is now fixed in git. Beware that WPopupMenu is one of the widgets
>> that is not available currently for JWt.
>>
>> > 3. Using WAnchor was also problematic. Assume we have some simple Java
>> > code:
>>
>> This code looks fine, and work fines, except for a common deployment
>> issue on java servlet engines, which needs to be emphasized much
>> better by us.
>>
>> By default, (almost?) all servlet engines will assume cookies for
>> session tracking. However, Wt (and JWt) work best when disabling
>> cookies for session tracking, for the simple reason that when using
>> cookies you cannot have more than one session in one browser. In your
>> example, you will only have one session which is being manipulated by
>> multiple windows -> mayhem.
>>
>> Cookies for session tracking are popular because it is easier to get
>> right, however (J)Wt does proper url encoding for you. Unfortunately,
>> each servlet engine requires a different way to disable cookies.
>>
>> * For jetty:
>> Put a jetty-web.xml in your WEB-INF folder with :
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
>>    "http://jetty.mortbay.org/configure.dtd";>
>> <Configure class="org.mortbay.jetty.webapp.WebAppContext">
>>    <Get name="sessionHandler">
>>        <Get name="sessionManager">
>>            <Set name="usingCookies" type="boolean">false</Set>
>>        </Get>
>>    </Get>
>> </Configure>
>>
>> * For jboss:
>> Put a context.xml in your WEB-INF folder with:
>> <Context cookies="false" />
>>
>> * For tomcat:
>> Put the same context.xml in your META-INF folder.
>>
>> What application server are you using ?
>>
>> Regards,
>> koen
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Verizon Developer Community
>> Take advantage of Verizon's best-in-class app development support
>> A streamlined, 14 day to market process makes app distribution fast and
>> easy
>> Join now and get one step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> witty-interest mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to