Session information missing after form submit

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

Session information missing after form submit

quinquin2209
Hi All,

I have a Java application which will load an xform for editing. When user press on the button, a page is reloaded based on the session information.

However, it is found that all session information is missing when the form is submited.

I am using Orbeon 3.6.

Any hints to solve this problem/?

Thanks in advance.

Queenie
Reply | Threaded
Open this post in threaded view
|

Re: Session information missing after form submit

Alessandro Vernet
Administrator
On Jan 31, 2008 1:59 AM, quinquin2209 <[hidden email]> wrote:
> I have a Java application which will load an xform for editing. When user
> press on the button, a page is reloaded based on the session information.
>
> However, it is found that all session information is missing when the form
> is submited.
>
> I am using Orbeon 3.6.

You mention a Java application that loads XForms for editing; are you
using separate deployment? What is stored in the session? What code
stores it? "Who" the form data is submitted to? Is that an
xforms:submission you are talking about? If it is, is it replace=
instance or all? I think we will need you to describe your situation
in more details.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
Reply | Threaded
Open this post in threaded view
|

Re: Session information missing after form submit

quinquin2209
Thanks for your reply.

I am doing separate deployment. In my web application, I use session to store some display-related information, e.g. language. The xform submission is done as follow:

<xforms:submission id="save-submission" ref="instance('doc-instance')"
action="<s:url value="%{saveXForm}" />"
method="post">

where the action is linking to an action of my web application.

When the form is submited, I found that my session becomes empty. I can't find those display-related information.


Queenie


Alessandro Vernet wrote
On Jan 31, 2008 1:59 AM, quinquin2209 <quinquin2209-noip@yahoo.com.hk> wrote:
> I have a Java application which will load an xform for editing. When user
> press on the button, a page is reloaded based on the session information.
>
> However, it is found that all session information is missing when the form
> is submited.
>
> I am using Orbeon 3.6.

You mention a Java application that loads XForms for editing; are you
using separate deployment? What is stored in the session? What code
stores it? "Who" the form data is submitted to? Is that an
xforms:submission you are talking about? If it is, is it replace=
instance or all? I think we will need you to describe your situation
in more details.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


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


-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/
Reply | Threaded
Open this post in threaded view
|

Re: Session information missing after form submit

Alessandro Vernet
Administrator
Queenie,

On Jan 31, 2008 6:07 PM, quinquin2209 <[hidden email]> wrote:

> I am doing separate deployment. In my web application, I use session to
> store some display-related information, e.g. language. The xform submission
> is done as follow:
>
> <xforms:submission id="save-submission" ref="instance('doc-instance')"
> action="<s:url value="%{saveXForm}" />"
> method="post">
>
> where the action is linking to an action of my web application.
>
> When the form is submited, I found that my session becomes empty. I can't
> find those display-related information.
OK, thank you for the additional details. Here is what *could* be happening:

1. The session cookie set by your application server is set for the
specific path of your app. Say /myapp.
2. You click on the button on the UI, the browser goes to
/ops/xforms-server-submit. Orbeon Forms handles that request. But
because the cookie has been set for /myapp, Orbeon Forms does not
receive your cookie. Orbeon Forms does a POST to your service,  but
can't pass along a cookie it did not receive.
3. Your page under /myapp to which the submission is directed does not
receive the session cookie.

I have added a bug for this:
http://forge.objectweb.org/tracker/index.php?func=detail&aid=308411&group_id=168&atid=350207

For now, you would have to avoid the submission replace="all". A
workaround would be to use method="get" instead of method="post". In
this case the browser would make the request and you would receive the
session cookie. You can still have parameters passed on the URL, but
you will be limited in the amount of data you can pass to the target
page.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
Reply | Threaded
Open this post in threaded view
|

RE: Session information missing after form submit

Dan Godley
Alex,

For extra info, I've also come across what might be the same problem in a nightly build from a couple of days ago.  I'm not using a separate deployment, but I am loading an XForms page via a normal JSP page.

My scenario is this:

1) I have a (non-XForms) JSP home page which creates a cookie containing a user ID at the root path (i.e. myCookie.setPath("/"));.
2) The user can then load an Orbeon XForms page from the home page.
3) On xforms-ready, the XForms page sends an xforms:submission to a servlet to populate an instance with some user data (<xforms:submission id="submit-get-init-data" replace="instance" instance="inst-main" action="http://localhost:8080/myApp/getInitData" method="get" /> ).
4) The servlet should then get the user ID from the cookie stored in the HttpServletRequest object and return some user data based on that ID.

Step 4 fails as the cookies collection from HttpServletRequest doesn't contain my user id cookie.  The application worked fine in the last stable release of 3.6.

Cheers, Dan

Dan Godley
Standards Developer
Origo Services Ltd

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro Vernet
Sent: 01 February 2008 04:34
To: [hidden email]
Subject: Re: [ops-users] Session information missing after form submit

Queenie,

On Jan 31, 2008 6:07 PM, quinquin2209 <[hidden email]> wrote:

> I am doing separate deployment. In my web application, I use session
> to store some display-related information, e.g. language. The xform
> submission is done as follow:
>
> <xforms:submission id="save-submission" ref="instance('doc-instance')"
> action="<s:url value="%{saveXForm}" />"
> method="post">
>
> where the action is linking to an action of my web application.
>
> When the form is submited, I found that my session becomes empty. I
> can't find those display-related information.
OK, thank you for the additional details. Here is what *could* be happening:

1. The session cookie set by your application server is set for the specific path of your app. Say /myapp.
2. You click on the button on the UI, the browser goes to /ops/xforms-server-submit. Orbeon Forms handles that request. But because the cookie has been set for /myapp, Orbeon Forms does not receive your cookie. Orbeon Forms does a POST to your service,  but can't pass along a cookie it did not receive.
3. Your page under /myapp to which the submission is directed does not receive the session cookie.

I have added a bug for this:
http://forge.objectweb.org/tracker/index.php?func=detail&aid=308411&group_id=168&atid=350207

For now, you would have to avoid the submission replace="all". A workaround would be to use method="get" instead of method="post". In this case the browser would make the request and you would receive the session cookie. You can still have parameters passed on the URL, but you will be limited in the amount of data you can pass to the target page.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/

E-mail disclaimer

The information in this e-mail is sent in confidence for the addressee only and may be legally privileged. Unauthorised recipients must preserve this confidentiality and should please advise the sender immediately of the error in transmission and then delete this e-mail. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on its content is prohibited and may be unlawful.

Origo Services Limited accepts no responsibility for any loss or damage resulting directly or indirectly from the use of this e-mail or the contents.  It is your responsibility to scan for viruses.  Origo Services Limited reserves the right to monitor e-mails sent to or from addresses under its control.  When you reply to this e-mail, you are consenting to Origo Services Limited monitoring the content of the e-mails you send to or receive from Origo Services Limited.  If this e-mail is non-business related Origo Services Limited is not liable for any opinions expressed by the sender.  The contents of this e-mail are protected by copyright.  All rights reserved.

Origo Services Limited is a company incorporated in Scotland (company number 115061) having its registered office at 4th floor, Saltire Court, 20 Castle Terrace, Edinburgh EH1 2EN.



--
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: Session information missing after form submit

Alessandro Vernet
Administrator
Dan,

On Feb 1, 2008, at 12:45 AM, Dan Godley wrote:

> For extra info, I've also come across what might be the same problem  
> in a nightly build from a couple of days ago.  I'm not using a  
> separate deployment, but I am loading an XForms page via a normal  
> JSP page.
>
> My scenario is this:
>
> 1) I have a (non-XForms) JSP home page which creates a cookie  
> containing a user ID at the root path (i.e. myCookie.setPath("/"));.
> 2) The user can then load an Orbeon XForms page from the home page.
> 3) On xforms-ready, the XForms page sends an xforms:submission to a  
> servlet to populate an instance with some user data  
> (<xforms:submission id="submit-get-init-data" replace="instance"  
> instance="inst-main" action="http://localhost:8080/myApp/ 
> getInitData" method="get" /> ).
> 4) The servlet should then get the user ID from the cookie stored in  
> the HttpServletRequest object and return some user data based on  
> that ID.
>
> Step 4 fails as the cookies collection from HttpServletRequest  
> doesn't contain my user id cookie.  The application worked fine in  
> the last stable release of 3.6.
Is your XForms application (single deployment) under /myApps? If it  
is, have you tried instead of action="http://localhost:8080/myApp/getInitData 
" to use action="/getInitData"?

When doing a submission, for security reasons, we don't want to  
forward cookies to an external server. So if you have a full URL  
(http://...) we need to figure out if this URL points to "this  
server". a) This is not as simple as it sounds, and b) there is maybe  
room for improvement in this code :). So if you can, it is better to  
use a path (like /getInitData) instead of a full URL.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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