Forums

Welcome Guest Search | Active Topics | Members

PRB: Image Uploader for Java looses HTTP-only cookies Options
Eugene Kosmin
Posted: Tuesday, June 24, 2008 9:07:04 PM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
Hi,

As I see the problem is not in authentication, your upload script tries to redirect the POST to another page. The code something like this could be the problem:

Code:
void Page_Load()
{
    //...
    Response.Redirect("redirectScript.aspx");
    //...
}


BTW, you can see the redirect URL in Java console.

I've changed AddCookie sample for windows authentication mode usage and it worked fine in Firefox. All I did is:

1. Remove the string with AddCookie method.

2. Change web.config authentication and authorization sections:

Code:
<authentication mode="Windows"/>

<authorization>
  <allow users="DomainName\DomainUser"/>
  <deny users="*"/>
</authorization>


Best regards,
Eugene Kosmin.

Aurigma Development Team
tmoney6000
Posted: Friday, July 18, 2008 7:22:16 AM
Rank: Member
Groups: Member

Joined: 1/30/2007
Posts: 5
Points: 12
I can't seem to get this resolved using php.

I tried using the posted solution and it seemed to fix the server redirect message (although I didn't realize it was asp right away d'oh! ) so my php session is gone.


I tried the following as a php equvalent...
Code:
function ImageUploader1_BeforeUpload(){
                            getImageUploader("ImageUploader1").AddCookie('PHPSESSID=<?=$_COOKIE['PHPSESSID']?>');
                        }
iu.addEventListener("BeforeUpload", "ImageUploader1_BeforeUpload");


Still get the server redirect error.

Any help would be appreciated.
Thanks.
Eugene Kosmin
Posted: Monday, July 21, 2008 5:00:01 AM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
Hi,

Your code looks proper.

Please try to test it with ActiveX Image Uploader, if the error is still pending – the problem is not with cookies.

And what was in java console dump after uploading?


Best regards,
Eugene Kosmin.

Aurigma Development Team
tmoney6000
Posted: Tuesday, July 22, 2008 5:26:39 AM
Rank: Member
Groups: Member

Joined: 1/30/2007
Posts: 5
Points: 12
PHP errors were turned off....The error showed up in the java console. Looks like there is no cookie problem altogether.
Thanks!
ycseattle
Posted: Sunday, July 27, 2008 8:40:18 PM
Rank: Member
Groups: Member

Joined: 7/27/2008
Posts: 10
Points: 30
hello,

I just downloaded the trial version today and run into the same problem with FireFox. The IE works fine. I used the suggested solution but it doesn't work. Is there any final works or did anybody get it working with FireFox?
Dmitry
Posted: Monday, July 28, 2008 12:16:24 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 500
Points: 330
ycseattle wrote:
hello,

I just downloaded the trial version today and run into the same problem with FireFox. The IE works fine. I used the suggested solution but it doesn't work. Is there any final works or did anybody get it working with FireFox?


Hello,

What error do you get? Have you tried to use Image Uploader ActiveX?

Sincerely yours,
Dmitry Sevostjanov.
ycseattle
Posted: Monday, July 28, 2008 9:31:14 AM
Rank: Member
Groups: Member

Joined: 7/27/2008
Posts: 10
Points: 30
Hi, thanks for the reply.
I downloaded the free trial yesterday. I am using Visual Studio 2008, but I was not able to add the ActiveX control into the VS toolbox (I selected the four items but they didn't show up in the toolbox), so I just copy&paste the "basic demo" in the sample folder. I modified the code and added the event listener. It works in IE but still getting the redirecting error in FireFox. I think I am using the latest version of everything. How do I use ActiveX? Thanks for your help!
ycseattle
Posted: Monday, July 28, 2008 3:24:02 PM
Rank: Member
Groups: Member

Joined: 7/27/2008
Posts: 10
Points: 30
This is what shows up in the Java Console when I use FireFox.
For some reason the IE does not work anymore, giving a different error saying "Some server-side error occurred".

Ideas?

Aurigma ImageUploader version: 5.1.10.0
Current document URL: http://localhost:1295/Albums/CreateNewAlbum
Reading cookies
Reading referer
Referer: http://localhost:1295/Albums/CreateNewAlbum
Reading additional form content
Uploading to http://localhost:1295/Albums/SaveUploadedPhoto
Setting HTTP params: Host=localhost; Port=1295
Cookies:[AlbumB=CA674199029A1E962BC6012D7E46F7D3215CD5780D725C0B3BA21FEEE121A8F2DBFE327D685E9CE9851DF114BA958232253F8AE2C5234228C0DDFE0405DAD1E0E1188D46EFAE0D167E1E9A074A77D7F0]
Starting upload
###Error occured###
Status=[ERROR]
Progress=[0]
ValueMax=[0]
Value=[11]
[ErrorPage]

[EndOfErrorPage]
Dmitry
Posted: Tuesday, July 29, 2008 5:28:09 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 500
Points: 330
Hello,

I guess the problem is with authentication. You pass authentication ID via cookie and lose it while uploading. You need to do the same trick as with sessions:
Code:

getImageUploader("ImageUploader1").AddCookie('USERID=Value');

USERID - cookie name, please, insert your authentication cookie name instead.
Value - authentication value.

Sincerely yours,
Dmitry Sevostjanov.
educap
Posted: Tuesday, September 02, 2008 5:26:14 PM
Rank: Newbie
Groups: Member

Joined: 8/19/2008
Posts: 1
Points: 3
Has this issue been resolved yet? I am having the same exact problem with FireFox. My upload script itself does not do a redirect, but my ImageUploader script includes

iu.addParam("RedirectUrl", "PhotoAlbums.aspx");

Eugene Kosmin wrote:
Redirect is still possible. The behavior you described should work correctly.

But you can’t do redirect from the script which handles your upload data. URL to this
script is specified in Action property. For example, you can’t do such thing in upload.aspx:
Code:
<script runat="server">
void Page_Load()
{
    Response.Redirect("RedirectAction.aspx");
}
</script>
Dmitry
Posted: Thursday, September 04, 2008 6:20:30 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 500
Points: 330
Hello,

Sorry, I did not understand whether you perform redirect in your server upload script or not. If not it should be a problem with forms authentication. The way to fix it is described in the first post of this thread.

Sincerely yours,
Dmitry Sevostjanov.
Dmitry
Posted: Thursday, September 04, 2008 6:28:25 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 500
Points: 330
Hello,

I just want to add the same trick with HTTP-Only cookies for session variables. All you need to fix the problem is to pass the cookie in the way described above. The name of cookie is ASP.NET_SessionId. You need to insert BeforeUpload event handler in your script and add the following:
Code:

function ImageUploader_BeforeUpload()
{
    getImageUploader("ImageUploader").AddCookie('"ASP.NET_SessionId"=
        <%= Request.Cookies["ASP.NET_SessionId"].Value %>;'
);
}


Sincerely yours,
Dmitry Sevostjanov.
parkeug
Posted: Monday, September 08, 2008 8:58:19 AM
Rank: Newbie
Groups: Member

Joined: 9/8/2008
Posts: 4
Points: 12
Hello, I am currently trying out Image Uploader Dual 5.5 with PHP 5. I was having a problem losing the HTTP cookie upon uploading, so I used the code posted above:

Code:

function ImageUploader1_BeforeUpload(){
                            getImageUploader("ImageUploader1").AddCookie('PHPSESSID=<?=$_COOKIE['PHPSESSID']?>');
                        }
iu.addEventListener("BeforeUpload", "ImageUploader1_BeforeUpload");


This fixed my problem on Firefox 2.0... everything works great there. On IE 6/7 I am still losing the cookie. On IE 6, I am getting a JavaScript runtime error "Object doesn't support this property or method" on the following line:

Code:

getImageUploader("ImageUploader1").AddCookie('PHPSESSID=<?=$_COOKIE['PHPSESSID']?>');


Any ideas? I've tried everything I can think of... thank you in advance.
Dmitry
Posted: Tuesday, September 09, 2008 2:15:30 AM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 500
Points: 330
Hello,

parkeug wrote:
This fixed my problem on Firefox 2.0... everything works great there. On IE 6/7 I am still losing the cookie. On IE 6, I am getting a JavaScript runtime error "Object doesn't support this property or method" on the following line:


The problem with loss of HTTP-only cookies concerns Java version only. So you should use AddCookie method with Image Uploader Java. To perform it you can add condition when you specify event handler calling AddCookie:
Code:

if (iu.getControlType() == "Java"){
    iu.addEventListener("BeforeUpload", "ImageUploader1_BeforeUpload");
}


Sincerely yours,
Dmitry Sevostjanov.
parkeug
Posted: Thursday, September 11, 2008 1:46:37 AM
Rank: Newbie
Groups: Member

Joined: 9/8/2008
Posts: 4
Points: 12
Dmitry,

Thank you for the help and the quick response. Unfortunately I am still losing the cookie in IE 6/7. The JavaScript runtime error has been resolved and was something else unrelated.

Do you have any ideas on how I can continue to troubleshoot this issue? This is the only thing holding me back from purchasing this great product. Thank you again for your help.
Dmitry
Posted: Thursday, September 11, 2008 9:21:15 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 500
Points: 330
Hello,

Do you use Java or ActiveX version in IE? The problem with cookies loss concerns Java version only. We had no reports on this problem with ActiveX before.

Sincerely yours,
Dmitry Sevostjanov.
parkeug
Posted: Monday, September 15, 2008 11:38:35 AM
Rank: Newbie
Groups: Member

Joined: 9/8/2008
Posts: 4
Points: 12
Dmitry,

I am using the ActiveX version in IE (5.5.6.0). I have tried several things but to no avail. If I use an empty upload.php and gallery.php, I still lose the cookie. Again, the Java version in Firefox works fine.

The cookie seems to disappear right as the file upload starts.

Is there anything I can do to troubleshoot this further? Thank you again for your time.
parkeug
Posted: Tuesday, September 16, 2008 9:05:35 AM
Rank: Newbie
Groups: Member

Joined: 9/8/2008
Posts: 4
Points: 12
Dmitry,

I am having the exact same problem described in this thread:
http://www.aurigma.com/Forums/yaf_postst1485.aspx

I am using CakePHP 1.2, and basically my session is getting wiped out in the ActiveX version.

I then came across this thread:
http://www.aurigma.com/Forums/yaf_postsm1878.aspx#1878

Is this in fact a known cause for this problem, and if so, will the recommended fix action be available any time soon?

Thank you again for your help. Again, I'd love to buy the product, but I desperately need session support.
Dmitry
Posted: Tuesday, September 16, 2008 8:19:56 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 500
Points: 330
Hello,

Okay, thank you for your detailed posts.

Could you submit a case with your problem in our support incidents management system and add a link to the page where you experience the issue there? We will do our best to troubleshoot it and provide you with a solution.

Sincerely yours,
Dmitry Sevostjanov.
nicola.baldi
Posted: Tuesday, September 23, 2008 12:14:40 AM
Rank: Newbie
Groups: Member

Joined: 9/23/2008
Posts: 1
Points: 3
Hello.
Adding FormsAuthentication cookie by the "AddCookie" method solve this problem partially.
Suppose to have the following scenario:

- Access to application Directory "Admin" is allowed only for authenticated users.
- An authenticated user try to upload a big amount of images.
- The upload process start correctly.
- While upload process is active, FormsAuthentication cookie expires.
- Upload process terminates and user is redirected to the url specified into the "RedirectUrl" property "/Admin/ShowUploadedImages.aspx".
- The ASP.NET runtime cannot find an athenticated user and forces a redirect to the login page ("/SignIn.aspx"):
- The aurigma ImageUploader cotrol shows the error "The server attempted to redirect you, but server rdirects are not supported".
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.