Skip to main content

WebBrowser doesn't pass cookies to popup!

43 replies [Last post]
yangui
Offline
Joined: 2006-02-17

Hi, very annoying situation because the server session is lost in the popup!

Yangui

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rbrench
Offline
Joined: 2006-02-14

Michael,
Thanks for the response!
With all due respect, I feel that this is an empty promise. I am quite surprised at the slow progress, since back in the early part of the year, you folks were making great progress on your releases.

If you could be so kind to answer the following questions, since my project is in jeopardy and I need to make some decisions.
- Is this fix actually feasible?
- If so, when can I/we expect to see this issue fixed and available in a downloadable build? (Please be as brutally honest and up-front as possible)

We appreciate the work that you and your team continue to do for this project.

Sincerely,
rbrench

michael_shan
Offline
Joined: 2005-05-29

Hi rbrench,

- A new method "setURL(URL url , String postData)" has been developed to fix this bug, but it still needs to be tested.

- We have made a plan last week to build a release, and it could be available this week. This fix will be included.

- Till now, issues to be included as below:
Issue 317 New method WebBrowser.setURL(URL, Strin postData, String headers)
Issue 323 System Tray icon does not use transparency
Issue 292 IndexOutOfBounds in WinUtility.getMozMailerLocation()
Issue 310 StringIndexOutOfBounds Exception in WinUtility when launching Mozilla Thunderbird
Issue 311 Seperate JDIC API release from JDIC Packager
Issue 324 Browser message client uses excessive CPU
Issue 320 ant buildtray forgets to include the png's
Issue 321 WinTrayIconService should call actionPerformed on WM_RBUTTONUP
Issue 328 bind Server Socket to loopback device only to avoid firewall issues
Issue 332 WebBrowser.getWebBrowserListeners() throws ClassCastException

Sorry for so late response and really much thank for your suggestion to JDIC.

thanks,
Michael

michael_shan
Offline
Joined: 2005-05-29

Sorry, the method should be "setURL(URL url,String postData,String header)" .

michael_shan
Offline
Joined: 2005-05-29

Hi rbrench,

I have to admit that I have made a mistake.We still don't solve this bug and it will not be include in the next build.

We still need to take deep into it and fix it in some future.
I can't give the exact date when this will be finished, but can only say that we will do that a.f.a.p.

thanks,
Michael

manish_agrwl
Offline
Joined: 2006-02-14

I am not sure, but the link below solved my problem related to not passing session information to child window.

https://jdic.dev.java.net/issues/show_bug.cgi?id=254

If required, i could provide the ieembed.exe which incorporates these changes

Manish

rbrench
Offline
Joined: 2006-02-14

Manish,

Thanks for the information!

Micheal, perhaps you should have your JDIC development team take a look at the link from Manish. It seems that maybe the issue may have already been fixed. This could save you folks a bunch of time.

One question I have for the entire forum: If this is an open source project why hasn't anyone (smarter than me) uploaded this fix to the project? After all isn't that what open source is all about?

Thanks
rbrench

manish_agrwl
Offline
Joined: 2006-02-14

Hi All,

I was able to send the header information etc. Problem with the solution by george is that it does not get the size and title of the new window from the java script. So each time it opens a window with about: blank as the title and 400*400 size window. Any idea how this can be resolved.

Regards
-- Manish

michael_shan
Offline
Joined: 2005-05-29

Hi,
It's like http://www.javadesktop.org/forums/thread.jspa?threadID=18908&tstart=0, pls. refer for it.

Message was edited by: michael_shan

rifraf
Offline
Joined: 2006-05-31

> Hi,
> It's like
> http://www.javadesktop.org/forums/thread.jspa?threadID
> =18908&tstart=0, pls. refer for it.
>
>
> Message was edited by: michael_shan

Sorry, this link appears to be broken.
Is there anything new regarding this issue. I'm evaluating WebBrowser for my current project but without this issue being resolved i have to look for some other solution.
Also i can't install MS Visual Studio for the sole purpose to apply the proposed patch. So if somebody can provide the built Ieembed.exe i would appreciate it.

tullio0106
Offline
Joined: 2004-05-13

Sorry but I don't understand where should I put that code.
Tks
Tullio

ksun
Offline
Joined: 2006-02-14

How does one access the DOM objects of a modal popup javascript window?
I am trying to populate the html via DOM but when one clicks on the button that brings up the modal popup my code with the reference to the IE DOM object freezes?
Do I have to access and use the DHTML object and interfaces?
How is this done?

dhodtong
Offline
Joined: 2007-12-26

First of all I want to express my appreciation to JDIC Browser team for the great effort and achievement.

However I stumbled upon this bug as well when using the latest version 0.9.3 I believe.

To me this is a show stopper. I think this is not a trivial problem. I want to help out solving this if anyone can provide some kick start on possible direction on how to fix this problem. I am new to this source code.

Thanks in advance.

tullio0106
Offline
Joined: 2004-05-13

Is it fixed in JDIC Plus ?
Tha
Tullio

amolhere
Offline
Joined: 2008-10-14

I am still facing this problem over http. Any resolution / direction.

bpfurtado
Offline
Joined: 2004-12-17

We have patched the alpha build from 20060308 but we are still experiencing the Popups problem reported at Issue 254 (https://jdic.dev.java.net/issues/show_bug.cgi?id=254).

Is this patch supposed to be aplied against which version?
Any other hints?

If someone has applied this patch and had other results than the ours could you send it to us?

thanks.

rbijelonic
Offline
Joined: 2004-06-10

This still does not work for Windows 2000 and IE 6.0.28.
Has anyone managed to work around this?

javanetkaminski
Offline
Joined: 2007-06-14

has this been fixed?

martinwe
Offline
Joined: 2006-04-20

Does someone already tried popup of popups with an jdic binary using the 254_patch.

bpfurtado
Offline
Joined: 2004-12-17

I would appreciate a build with this patch, a lot!

Why there is no release since september? This pop issue seems to be very important to this API users.

Can't be that hard to the developers who already have all the environment intalled/configured.

Any possibility of a release any time soon?

michael_shan
Offline
Joined: 2005-05-29

Hi,
I think our build 20060308 has fixed this bug, have you tried that?

rifraf
Offline
Joined: 2006-05-31

> Hi,
> I think our build 20060308 has fixed this bug, have
> you tried that?

Can't find any change of behaviour. Still the cookie is not passed to the popup window and the application forces a new login.
And it seems to me that the patch is not included in this build. The patch introduces two new files (BrowserFrameWindow.cpp, BrowserFrameWindow.h) which i cannot find in the sources of the build. Also the changelog says that build 254 is still to be resolved.

michael_shan
Offline
Joined: 2005-05-29

Hi,
Could you please post your sample here? Let's reproduce it and see what's wrong on earth.

Thanks,
Michael

rifraf
Offline
Joined: 2006-05-31

> Hi,
> Could you please post your sample here? Let's
> reproduce it and see what's wrong on earth.
>
Hi Michael,
the problem can easily reproduced with the URL mentioned in post #3 in this thread: http://www.yvesrepiquet.com/idtest.php

When you open this URL with the Internet Explorer and press the button, the session id and the cookie in the pop up window keep the value from the parent window. When you do the same with an integrated WebBrowser (the demo browser f.i.) you'll see that session id and cookie value are different in parent window and pop up.

My task is to integrate a third party web application into our Java Swing application so it's hard to generate a sample on my own. The code in my application is quite simple, basically it's
creating the browser:
WebBrowser webBrowser = new WebBrowser()

registering a listener:
webBrowser.addWebBrowserListener(
new WebBrowserListener()
{
boolean isFirstPage = true;

public void downloadStarted(WebBrowserEvent event)
{
;
}

public void downloadCompleted(WebBrowserEvent event)
{
;
}

public void downloadProgress(WebBrowserEvent event)
{
;
}

public void downloadError(WebBrowserEvent event)
{
;
}

public void documentCompleted(WebBrowserEvent event)
{
if (isFirstPage)
{
isFirstPage = false;
try
{
browser.setURL(new URL());
}
catch (MalformedURLException f)
{
f.printStackTrace();
}
}
public void titleChange(WebBrowserEvent event)
{
;
}

public void statusTextChange(WebBrowserEvent event)
{
;
}
}
);

setting a URL for programatic login into the web application:
browser.setURL(new URL());

But i think the URL above is sufficient for reproducing the problem and testing a solution. If a fixed WebBrowser passes this test (meaning that session id and cookie have the same value in parent and popup) i'm quite confident that my problem is also resolved.

Let me know if you need more information,
Rafael

michael_shan
Offline
Joined: 2005-05-29

Hi,

This bug has really been fixed, but it's not integreated into the latest build(I'm not sure why :( ). We'll work on that and give you feedback soon.

rifraf
Offline
Joined: 2006-05-31

That's great news. Are there also plans for new official release?

rbrench
Offline
Joined: 2006-02-14

Help!!!
I need this fixed as well for a critical part of an app that we are building for a bunch of clients who are running out of patience. We have been waiting for months for this.

Is there anything I can do to help speed up the release of this bug fix? At this point I am almost willing to pay to have this fixed!

rbrench

michael_shan
Offline
Joined: 2005-05-29

Hi rbrench,

Since the time to make a formal release is some long, we will provide an alpha builds of JDIC to solve this problem.

These builds are not tested carefully, they main to provide fast response to developers.
We will take fast steps on this.

thanks,
Michael

manish_agrwl
Offline
Joined: 2006-02-14

Roughly, by what date can we expect an alpha release. We will accordingly take that in our planning process. An what would be the exact issue resolved, so that we dont set wrong expectations from the alpha build.

Thank
-- Manish

rbrench
Offline
Joined: 2006-02-14

Help!!!
I need this fixed as well for a critical part of an application that we are building for a bunch of clients who are running out of patience. We have been waiting for months for this.

Is there anything I can do help speed up the release of this bug fix? At this point I am almost willing to pay to have this fixed!

rbrench

Conciliator
Offline
Joined: 2006-02-14

Don't you love it when you're wrong...

Apparently, the previous solution of mine is no solution at all. It does the exact same thing as if the window.open is not mediated by the NewWindow2 event.

Note that the session variables CAN still be passed in these circumstances (or with a new InternetExplorer object) IF the secure page/session of the webBrowser is already open in a regular IE browsing window.

This equates to a ton of confusion for the programmer who debugs his program while having the secure pages open in standard IE windows, perhaps for 'reference.' During this time, window.open pop-ups from the secure webBrowser object SEEM to pass session variables. IN FACT, the pop-ups are somehow obtaining the session from the standard IE 'reference' window in the background.

As soon as the program is run with the reference windows closed, the problem surfaces: no session is passed to the pop-up. Soultion: use the NewWindow2 or NewWindow3 event and put that pop-up in a new webBrowser oject in your project. Or, have that same secure page already loaded up in IE.

Hope that helps

Message was edited by: ejrenaud

Conciliator
Offline
Joined: 2006-02-14

This issue truly needs to be addressed my Microsoft. I can't tell you how many hours I wasted trying to figure out why I was losing my session in the pop-up.

To replicate this bug, three criteria must be met:
1) a WebBrowser control is used
2) an https/secure session is running
3) a Javascript 'window.open' is issued on the page

Under these circumstances, a new instance of IE is opened (as it should). However, this new instance does NOT maintain the WebBrowser's session state and variables. It is as though the window.open URL is being launched in a new, blank IE browser.

The simplest solution to this problem is to add the following code to the WebBrowser's NewWindow2 or NewWindow3 (only in XP, SP2 or higher) event:

Private Sub wbMain_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim iePopUpFixed As InternetExplorer
Set ppDisp = iePopUpFixed
End Sub

...and wah-lah, no more lost sessions in your pop-ups. Alternately, you could use a webbrowser object for the new window, as in Spond's code above, but you're in for a lot more hassle, not to mention issues with dynamically resizing the webbrowser control when the form is resized, which is generally a pain in the rear. Hopefully this can save you some time and grief.

Message was edited by: ejrenaud

Al Hanley

I got this error msg recently:
Title bar = "CiceroUIWndFrame: IeEmbed.exe - Application Error"
Error = "the instruction at X referenced memory at X. Then memory could not
be read"

Next question. Will there ever be support for FireFox being the default
browser on a Windows machine?

---------------------------------------------------------------------
To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
For additional commands, e-mail: jdic-help@jdic.dev.java.net

georgez
Offline
Joined: 2003-08-19

Hi Al,

> I got this error msg recently:
> Title bar = "CiceroUIWndFrame: IeEmbed.exe -
> Application Error"
> Error = "the instruction at X referenced memory at X.
> Then memory could not
> be read"
I need to take a look at it. What JDIC version are you using?

> Next question. Will there ever be support for
> FireFox being the default
> browser on a Windows machine?
We would like to support embedding FireFox, but there is a bug embedding it. See:
https://jdic.dev.java.net/documentation/faq.html#What%20are%20the%20embe...?

On the other hand, if Mozilla is not the default browser, JDIC Browser will always embed IE instead. So, if you don't care those difference between IE/FireFox, this might be acceptable.

Thanks,
-George.

>
> ------------------------------------------------------
> ---------------
> To unsubscribe, e-mail:
> jdic-unsubscribe@jdic.dev.java.net
> For additional commands, e-mail:
> jdic-help@jdic.dev.java.net

Al Hanley

Hi,

I'm using JDIC version 0.9 for windows, and I get that error every time I
close the window when I run the SimpleBrowser.java example.

--Al

----- Original Message -----
From:
To:
Sent: Monday, July 04, 2005 9:05 PM
Subject: Re: IeEmbed.exe error & FireFox question

> Hi Al,
>
>> I got this error msg recently:
>> Title bar = "CiceroUIWndFrame: IeEmbed.exe -
>> Application Error"
>> Error = "the instruction at X referenced memory at X.
>> Then memory could not
>> be read"
> I need to take a look at it. What JDIC version are you using?
>
>> Next question. Will there ever be support for
>> FireFox being the default
>> browser on a Windows machine?
> We would like to support embedding FireFox, but there is a bug embedding
> it. See:
> https://jdic.dev.java.net/documentation/faq.html#What%20are%20the%20embe...?
>
> On the other hand, if Mozilla is not the default browser, JDIC Browser
> will always embed IE instead. So, if you don't care those difference
> between IE/FireFox, this might be acceptable.
>
> Thanks,
> -George.
>> ------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
For additional commands, e-mail: jdic-help@jdic.dev.java.net

manish_agrwl
Offline
Joined: 2006-02-14

I am facing the same issue, that the pop up window that is opened through java script does not have the session information and the user has to provide login details again. It is really bugging us. and we are also not getting any response from the JDIC developer community.

I have posted issues in different threads but there has been no response at all.

There seems to be a work around by passing header information through setURL API, but there is no bi-weekly build of JDIC since July, which can be downloaded.

We are using:

JDIC 0.9.1
Tomcat 5 with basic authentication

Thanks
Manish

tromney
Offline
Joined: 2006-05-05

I would also like to see a new build regarding this issue

spond
Offline
Joined: 2006-02-17

All,

I am affected by this issue too. Doing a little research on the Web, I found a post about a similar issue when using the MS WebBrowser Control and popups. This person's solution in VB.NET should be applicable to the JDIC C++ code too.

From URL http://weblog.am89.com/

Hi everyone. This is not a request for assistance, but I wanted to post a solution to a problem I solved after a lot of searching around. Hopefully it will save someone else some aggravation.

I built a VB6.0 application which uses Microsoft's WebBrowser control. Whenever a Javascript window.open was called from a secure page, the new page opened an instance of IE on the client machine. This new browser would no longer have the Session state and variables stored of the WebBrowser's session. However, by having my app create a new VB form with its own WebBrowser control, the new WebBrowser could be set to open the new page and maintain session state.

VB Code for this is called in the NewWindow2 event. I call a subroutine because I actually have more than one WebBrowser in my app and each of them may handle this. frmWeb is just a form in my project with a WebBrowser control and any other controls you may want to add; for example, a "Back" button.

Private Sub wbWebSite_NewWindow2(ppDisp As Object, Cancel As Boolean)
MakeChildBrowser ppDisp
End Sub

Private Sub MakeChildBrowser(ByRef ppDisp As Object)
'Retain session by using another WebBrowser for popups. Otherwise a new IE instance will appear

Dim frmWB As frmWeb
Set frmWB = New frmWeb

frmWB.wbChild.RegisterAsBrowser = True

Set ppDisp = frmWB.wbChild.Object
frmWB.Visible = True

End Sub

Don't forget to clean up your form when you close the parent form.

The problem with Session state did not seem to arise when using window.open from non-secure pages. For example, Yahoo's child windows worked fine, but https pages did not. I assume that was due to the different backends processing cookies versus session variables, but I was not privy to the backend code, so I am guessing at this.

javaguy5
Offline
Joined: 2008-11-24

This solution worked in the test enviornment, however it failed to upon implementation with the same error message as before (Session variable blank). When not in the test enviornment the 2nd form did not appear instead IE did. Any idea why the form would exit and IE would start during implementation but not testing?

Message was edited by: javaguy5

btknorr
Offline
Joined: 2005-04-12

Any word on a fix for this issue? We are experiencing the same issue using the WebBrowser api against our web application (running on Weblogic)...we cannot move forward with JDIC until this session issue is resolved.

Thanks,

Brian

btknorr
Offline
Joined: 2005-04-12

Any resolution on this yet? I entered it as a bug in the issue tracking system - issue #254....thanks,

Brian

yangui
Offline
Joined: 2006-02-17

George, please tell me if you need more infos !

Yangui

yangui
Offline
Joined: 2006-02-17

You can monitor on this page the changing values :
http://www.yvesrepiquet.com/idtest.php

The session id should remain unchanged (in the case of php it's a cookie named PHPSESSID).
Similarly a cookie named TEST is set with a time value and should remain identical.

Yangui

georgez
Offline
Joined: 2003-08-19

Hi,
Any sample site for me to check it out? thanks !

-George.