latest Orbeon build still losing the session

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

latest Orbeon build still losing the session

Jean Luc-2
Hi Erik,

I've been experiencing the same problem of losing the session when POSTing. I tried with 3.6.0.200712202109 but the problem is still there.

Details:
  • separate deployment.
  • oxf.xforms.optimize-local-submission is false
Flow: a simple form with one field is fetched, then submitted.
Problem: the session is lost between GET and POST so it's not possible to store contextual data there.

I've updated the test JSP that I sent in the test application I gave you the other day. You'll find the JSP and the log of the traffic below:

07/12/21 11:21:27 Request = GET /myapp/myweb/jsp/test.jsp
07/12/21 11:21:27 Session: id = 0a40024b22b8af36afd0b7134877bc62fdb09bb4f8b6
07/12/21 11:21:27       CreationTime = Fri Dec 21 11:21:27 EST 2007
07/12/21 11:21:27       lastAccessedTime = Fri Dec 21 11:21:27 EST 2007
07/12/21 11:21:43 Request = POST /myapp/myweb/jsp/test.jsp
07/12/21 11:21:43 cookie:name = JSESSIONID, value=0a40024b22b831aa338a78a2413ab69ebf01c29c9238
07/12/21 11:21:43 Session: id = 0a40024b22b8ae2cba7510e8499d8adefb78122ce62b
07/12/21 11:21:43       CreationTime = Fri Dec 21 11:21:43 EST 2007
07/12/21 11:21:43       lastAccessedTime = Fri Dec 21 11:21:43 EST 2007

You see the second JSESSIONID is different. Logging the traffic showed the following:

The response to the initial GET set a sessionid cookie:

HTTP/1.1 200 OK
Date: Fri, 21 Dec 2007 16:28:21 GMT
Server: Oracle Containers for J2EE
Content-Location: http://testhost:8888/ops/xforms-renderer
Set-Cookie: JSESSIONID=0a40024b22b81a975ab82d47472d907ad2eb5cae0cd3; path=/ops
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Content-Type: text/html; charset=utf-8
Last-Modified: Fri, 21 Dec 2007 16:28:21 GMT
Expires: Fri, 21 Dec 2007 16:28:21 GMT
Cache-Control: post-check=0, pre-check=0
Pragma:
Transfer-Encoding: chunked

Then there is a xxforms:event-request POSTs without a cookie:

<!DOCTYPE xxforms:event-request [<!ENTITY nbsp "&#160;">]>
<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <xxforms:static-state>pers:7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E</xxforms:static-state>
    <xxforms:dynamic-state>pers:F1F856EC-0609-856D-3C0B-1ADDFC11E313</xxforms:dynamic-state>
    <xxforms:action>
        <xxforms:event name="DOMFocusIn" source-control-id="xforms-element-4"></xxforms:event>
    </xxforms:action>
</xxforms:event-request>

The answer to this request does not contain a cookie.

Then there is a second xxforms:event-request whose response does contain a new cookie:

<!DOCTYPE xxforms:event-request [<!ENTITY nbsp "&#160;">]>
<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <xxforms:static-state>pers:7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E</xxforms:static-state>
    <xxforms:dynamic-state>pers:F1F856EC-0609-856D-3C0B-1ADDFC11E313</xxforms:dynamic-state>
    <xxforms:action>
        <xxforms:event name="xxforms-value-change-with-focus-change" source-control-id="xforms-element-4">aaaa</xxforms:event>
        <xxforms:event name="DOMFocusOut" source-control-id="xforms-element-4"></xxforms:event>
        <xxforms:event name="DOMFocusIn" source-control-id="xforms-element-6"></xxforms:event>
    </xxforms:action>
</xxforms:event-request>



HTTP/1.1 200 OK
Date: Fri, 21 Dec 2007 16:28:27 GMT
Server: Oracle Containers for J2EE
Content-Location: http://testhost :8888/ops/xforms-server
Set-Cookie: JSESSIONID=0a40024b22b8cffcc1644fff454d837883044028cc8f; path=/ops
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Content-Type: application/xml; charset=utf-8
Last-Modified: Fri, 21 Dec 2007 16:28:28 GMT
Expires: Fri, 21 Dec 2007 16:28:28 GMT
Cache-Control: must-revalidate
Pragma:
Transfer-Encoding: chunked


A third event POST with the following contents, does not contain the cookie.

<!DOCTYPE xxforms:event-request [<!ENTITY nbsp "&#160;">]>
<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms ">
    <xxforms:static-state>pers:7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E</xxforms:static-state>
    <xxforms:dynamic-state>pers:AC1A2932-9849-47A9-610D-8F5E31B0C279</xxforms:dynamic-state>
    <xxforms:action>
        <xxforms:event name="DOMActivate" source-control-id="xforms-element-6"></xxforms:event>
    </xxforms:action>
</xxforms:event-request>

And the POST for the form submission contains the second cookie. The first is gone.

POST /ops/xforms-server-submit HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
Referer: http://testhost:8888/myapp/myweb/jsp/test.jsp
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: testhost:8888
Content-Length: 637
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=0a40024b22b8cffcc1644fff454d837883044028cc8f

%24static-state=pers%3A7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E&%24dynamic-state=pers%3AAC1A2932-9849-47A9-610D-8F5E31B0C279&%24server-events=X2y6DZ%2F6qm2DVz4pc7gQetVNz29jPV4yPY3xtaKOW%2BoFk4P2obpNW7dHDZeLo8ANGMgfWQxD%2Bg%2BDZ0+k6KSQkwS3xlRSQBM2ljACunHSgxX3FdcpxHvCCwkhTkGdQ4DtBkruDc3tGg8HAHR1yVsgrzOr8k7+I6qjDF8zk1rkWdwhe8izHJUEGPMTfEmF7Twde4NU5yijP8JJpGsfu1vBzggxuTRrOQ92sbElm08V+P4EGZKhI63ks4JqAsA%3D%3D&%24client-state=ajax-dynamic-state%26pers%253AAC1A2932-9849-47A9-610D-8F5E31B0C279%26initial-dynamic-state%26pers%253AF1F856EC-0609-856D-3C0B-1ADDFC11E313%26load-did-run%26true&%24repeat-tree=&%24repeat-indexes=&xforms-element-4=aaaa


The test JSP is below

<%@ page import="java.util.Date " %>
<%@ page session="true" %>
<%
    response.setHeader("Content-Type", "application/xml");
    response.setHeader("Pragma", "no-cache");   
    response.setHeader("Cache-Control", "private no-cache");
    response.setHeader("Expires", "0");
%>

<%
    System.out.println("Request = " + request.getMethod() + " " + request.getRequestURI());
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
        for (int i = 0; i < cookies.length; i++) {
            System.out.println("cookie:" + ("name = " + cookies[i].getName() + ", value=" + cookies[i].getValue()));
        }
    }
    System.out.println("Session: id = " + session.getId());
    System.out.println("\tCreationTime = " + new Date(session.getCreationTime()));
    System.out.println("\tlastAccessedTime = " + new Date( session.getLastAccessedTime()));
%>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:xsd=" http://www.w3.org/2001/XMLSchema"
      xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation=" http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml.xsd
                          http://www.w3.org/2002/xforms http://www.w3.org/2002/xforms/xforms.xsd">
<head>
    <xf:model>
        <xf:instance id="form-data" xmlns="">
            <acm-data>
                <importable-data>
                    <asset>
                        <description/>
                    </asset>
                </importable-data>
            </acm-data>
        </xf:instance>

        <xf:submission method="post" id="form-submit" action="/myapp/myweb/jsp/test.jsp" omit-xml-declaration="true" indent="true"/>
    </xf:model>
</head>

<body>
<xf:input ref="importable-data/asset/description">
    <xf:label>description</xf:label>
</xf:input>
<xf:submit submission="form-submit">
    <xf:label>Submit</xf:label>
</xf:submit>
</body>
</html>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: latest Orbeon build still losing the session

Jean Luc-2
Re-sending since it's been 2 weeks and the problem could get lost in the email since.... Thanks.

On Dec 21, 2007 11:45 AM, Jean Luc <[hidden email]> wrote:
Hi Erik,

I've been experiencing the same problem of losing the session when POSTing. I tried with 3.6.0.200712202109 but the problem is still there.

Details:
  • separate deployment.
  • oxf.xforms.optimize-local-submission is false
Flow: a simple form with one field is fetched, then submitted.
Problem: the session is lost between GET and POST so it's not possible to store contextual data there.

I've updated the test JSP that I sent in the test application I gave you the other day. You'll find the JSP and the log of the traffic below:

07/12/21 11:21:27 Request = GET /myapp/myweb/jsp/test.jsp
07/12/21 11:21:27 Session: id = 0a40024b22b8af36afd0b7134877bc62fdb09bb4f8b6
07/12/21 11:21:27       CreationTime = Fri Dec 21 11:21:27 EST 2007
07/12/21 11:21:27       lastAccessedTime = Fri Dec 21 11:21:27 EST 2007
07/12/21 11:21:43 Request = POST /myapp/myweb/jsp/test.jsp
07/12/21 11:21:43 cookie:name = JSESSIONID, value=0a40024b22b831aa338a78a2413ab69ebf01c29c9238
07/12/21 11:21:43 Session: id = 0a40024b22b8ae2cba7510e8499d8adefb78122ce62b
07/12/21 11:21:43       CreationTime = Fri Dec 21 11:21:43 EST 2007
07/12/21 11:21:43       lastAccessedTime = Fri Dec 21 11:21:43 EST 2007

You see the second JSESSIONID is different. Logging the traffic showed the following:

The response to the initial GET set a sessionid cookie:

HTTP/1.1 200 OK
Date: Fri, 21 Dec 2007 16:28:21 GMT
Server: Oracle Containers for J2EE
Content-Location: http://testhost:8888/ops/xforms-renderer
Set-Cookie: JSESSIONID=0a40024b22b81a975ab82d47472d907ad2eb5cae0cd3; path=/ops
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Content-Type: text/html; charset=utf-8
Last-Modified: Fri, 21 Dec 2007 16:28:21 GMT
Expires: Fri, 21 Dec 2007 16:28:21 GMT
Cache-Control: post-check=0, pre-check=0
Pragma:
Transfer-Encoding: chunked

Then there is a xxforms:event-request POSTs without a cookie:

<!DOCTYPE xxforms:event-request [<!ENTITY nbsp "&#160;">]>
<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <xxforms:static-state>pers:7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E</xxforms:static-state>
    <xxforms:dynamic-state>pers:F1F856EC-0609-856D-3C0B-1ADDFC11E313</xxforms:dynamic-state>
    <xxforms:action>
        <xxforms:event name="DOMFocusIn" source-control-id="xforms-element-4"></xxforms:event>
    </xxforms:action>
</xxforms:event-request>

The answer to this request does not contain a cookie.

Then there is a second xxforms:event-request whose response does contain a new cookie:

<!DOCTYPE xxforms:event-request [<!ENTITY nbsp "&#160;">]>
<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
    <xxforms:static-state>pers:7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E</xxforms:static-state>
    <xxforms:dynamic-state>pers:F1F856EC-0609-856D-3C0B-1ADDFC11E313</xxforms:dynamic-state>
    <xxforms:action>
        <xxforms:event name="xxforms-value-change-with-focus-change" source-control-id="xforms-element-4">aaaa</xxforms:event>
        <xxforms:event name="DOMFocusOut" source-control-id="xforms-element-4"></xxforms:event>
        <xxforms:event name="DOMFocusIn" source-control-id="xforms-element-6"></xxforms:event>
    </xxforms:action>
</xxforms:event-request>



HTTP/1.1 200 OK
Date: Fri, 21 Dec 2007 16:28:27 GMT
Server: Oracle Containers for J2EE
Content-Location: http://testhost :8888/ops/xforms-server
Set-Cookie: JSESSIONID=0a40024b22b8cffcc1644fff454d837883044028cc8f; path=/ops
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Content-Type: application/xml; charset=utf-8
Last-Modified: Fri, 21 Dec 2007 16:28:28 GMT
Expires: Fri, 21 Dec 2007 16:28:28 GMT
Cache-Control: must-revalidate
Pragma:
Transfer-Encoding: chunked


A third event POST with the following contents, does not contain the cookie.

<!DOCTYPE xxforms:event-request [<!ENTITY nbsp "&#160;">]>
<xxforms:event-request xmlns:xxforms="http://orbeon.org/oxf/xml/xforms ">
    <xxforms:static-state>pers:7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E</xxforms:static-state>
    <xxforms:dynamic-state>pers:AC1A2932-9849-47A9-610D-8F5E31B0C279</xxforms:dynamic-state>
    <xxforms:action>
        <xxforms:event name="DOMActivate" source-control-id="xforms-element-6"></xxforms:event>
    </xxforms:action>
</xxforms:event-request>

And the POST for the form submission contains the second cookie. The first is gone.

POST /ops/xforms-server-submit HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
Referer: http://testhost:8888/myapp/myweb/jsp/test.jsp
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Avant Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: testhost:8888
Content-Length: 637
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: JSESSIONID=0a40024b22b8cffcc1644fff454d837883044028cc8f

%24static-state=pers%3A7B66C2D9-7DE0-0509-1EE4-0A2019B16C9E&%24dynamic-state=pers%3AAC1A2932-9849-47A9-610D-8F5E31B0C279&%24server-events=X2y6DZ%2F6qm2DVz4pc7gQetVNz29jPV4yPY3xtaKOW%2BoFk4P2obpNW7dHDZeLo8ANGMgfWQxD%2Bg%2BDZ0+k6KSQkwS3xlRSQBM2ljACunHSgxX3FdcpxHvCCwkhTkGdQ4DtBkruDc3tGg8HAHR1yVsgrzOr8k7+I6qjDF8zk1rkWdwhe8izHJUEGPMTfEmF7Twde4NU5yijP8JJpGsfu1vBzggxuTRrOQ92sbElm08V+P4EGZKhI63ks4JqAsA%3D%3D&%24client-state=ajax-dynamic-state%26pers%253AAC1A2932-9849-47A9-610D-8F5E31B0C279%26initial-dynamic-state%26pers%253AF1F856EC-0609-856D-3C0B-1ADDFC11E313%26load-did-run%26true&%24repeat-tree=&%24repeat-indexes=&xforms-element-4=aaaa


The test JSP is below

<%@ page import="java.util.Date " %>
<%@ page session="true" %>
<%
    response.setHeader("Content-Type", "application/xml");
    response.setHeader("Pragma", "no-cache");   
    response.setHeader("Cache-Control", "private no-cache");
    response.setHeader("Expires", "0");
%>

<%
    System.out.println("Request = " + request.getMethod() + " " + request.getRequestURI());
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
        for (int i = 0; i < cookies.length; i++) {
            System.out.println("cookie:" + ("name = " + cookies[i].getName() + ", value=" + cookies[i].getValue()));
        }
    }
    System.out.println("Session: id = " + session.getId());
    System.out.println("\tCreationTime = " + new Date(session.getCreationTime()));
    System.out.println("\tlastAccessedTime = " + new Date( session.getLastAccessedTime()));
%>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xf="http://www.w3.org/2002/xforms"
      xmlns:xsd=" http://www.w3.org/2001/XMLSchema"
      xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation=" http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml.xsd
                          http://www.w3.org/2002/xforms http://www.w3.org/2002/xforms/xforms.xsd">
<head>
    <xf:model>
        <xf:instance id="form-data" xmlns="">
            <acm-data>
                <importable-data>
                    <asset>
                        <description/>
                    </asset>
                </importable-data>
            </acm-data>
        </xf:instance>

        <xf:submission method="post" id="form-submit" action="/myapp/myweb/jsp/test.jsp" omit-xml-declaration="true" indent="true"/>
    </xf:model>
</head>

<body>
<xf:input ref="importable-data/asset/description">
    <xf:label>description</xf:label>
</xf:input>
<xf:submit submission="form-submit">
    <xf:label>Submit</xf:label>
</xf:submit>
</body>
</html>




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: latest Orbeon build still losing the session

Alessandro Vernet
Administrator
Jean Luc wrote
The response to the initial GET set a sessionid cookie:

HTTP/1.1 200 OK
Date: Fri, 21 Dec 2007 16:28:21 GMT
Server: Oracle Containers for J2EE
Content-Location: http://testhost:8888/ops/xforms-renderer
Set-Cookie: JSESSIONID=0a40024b22b81a975ab82d47472d907ad2eb5cae0cd3;
path=/ops
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Content-Type: text/html; charset=utf-8
Last-Modified: Fri, 21 Dec 2007 16:28:21 GMT
Expires: Fri, 21 Dec 2007 16:28:21 GMT
Cache-Control: post-check=0, pre-check=0
Pragma:
Transfer-Encoding: chunked

Then there is a xxforms:event-request POSTs without a cookie:
[...]
That part is already surprising to me. When the initial page was loaded, a cookie was set for /ops; then the Ajax query should go to http://testhost:8888/ops/xforms-server; so the cookie that was set initially should be sent by the browser. Does the Ajax query go to a different host? Or am I missing something else?

Alex
Reply | Threaded
Open this post in threaded view
|

Re: latest Orbeon build still losing the session

Jean Luc-2
It was the same host (testhost is the local machine), no other machine is involved.

On Jan 8, 2008 10:18 PM, Alessandro Vernet <[hidden email]> wrote:


Jean Luc wrote:

>
> The response to the initial GET set a sessionid cookie:
>
> HTTP/1.1 200 OK
> Date: Fri, 21 Dec 2007 16:28:21 GMT
> Server: Oracle Containers for J2EE
> Content-Location: http://testhost:8888/ops/xforms-renderer
> Set-Cookie: JSESSIONID=0a40024b22b81a975ab82d47472d907ad2eb5cae0cd3;
> path=/ops
> Connection: Keep-Alive
> Keep-Alive: timeout=15, max=100
> Content-Type: text/html; charset=utf-8
> Last-Modified: Fri, 21 Dec 2007 16:28:21 GMT
> Expires: Fri, 21 Dec 2007 16:28:21 GMT
> Cache-Control: post-check=0, pre-check=0
> Pragma:
> Transfer-Encoding: chunked
>
> Then there is a xxforms:event-request POSTs without a cookie:
> [...]
>

That part is already surprising to me. When the initial page was loaded, a
cookie was set for /ops; then the Ajax query should go to
http://testhost:8888/ops/xforms-server; so the cookie that was set initially
should be sent by the browser. Does the Ajax query go to a different host?
Or am I missing something else?

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/

--
View this message in context: http://www.nabble.com/latest-Orbeon-build-still-losing-the-session-tp14567996p14704468.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: latest Orbeon build still losing the session

Alessandro Vernet
Administrator
Hi Jean Luc,

Jean Luc wrote
It was the same host (testhost is the local machine), no other machine is
involved.
In this case I don't see why the browser isn't sending the Cookie in the Ajax query. Do you? ;)

Can you try this again:

1. Remove the JSESSIONID cookie in your browser.
2. Load the page. Check that JSESSIONID has been set.
3. Change some value in the form and tab out so an Ajax event goes to the server. Check that the JSESSIONID is sent in the POST. In your previous test it looked like JSESSIONID was not sent in that Ajax request.  

Alex