SignOut() doesnt work within Upload <form...>

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

SignOut() doesnt work within Upload <form...>

Guest-26

Hi :)

at my ASP Page i got a Login/Logout mechanism and i included the NeatUpload in my existing <form> Tag,

but unfortunately the typically SignOut button/process doesnt work anymore. :(

FormsAuthentication.SignOut();
Response.Redirect("Logon.aspx", true);

After signing out, i can still can access the neatupload.asmx by just entering the url in the current browser. The only solution is to close the browser, but thats not the right solution. :)

Any Ideas how to solve this ? thanks a lot.
Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Guest-26
doh, nvm, i just found the error... i forgot to remove the id="uploadForm" inside the <form..> tag.
Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Guest-26

Umm, i was too overhasty, the same error still occurs. :(

No Clue why the page isnt SignOut correctly.

Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Dean Brettle
Administrator
Thanks for the bug report.  Can you try making the following change (in bold) to UploadHttpModule.cs, rebuild NeatUpload, and reinstall bin\{ConfigYouBuilt}\Brettle.Web.NeatUpload.dll, and retest?

        private void Application_PreSendRequestHeaders(object sender, EventArgs e)
        {
            if (false)
            {
                HttpApplication app = sender as HttpApplication;
                app.Response.ClearHeaders();
                app.Response.ClearContent();
            }
        }

If you have problems rebuilding, let me know and I'll make a special build available.

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Guest-26

Hi,

ok, last time, i just copied the 2 dll files from \bin folder to my project \bin folder and added them as reference to my project.

So now i just rebuild NeatUpload with the change u mentioned, taking the new dll and overwrite it with the dll i got already in my project folder and rebuild it too ?

Just making sure, thats the right way to do it.

Thx, for the help, i will test asap.

Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Dean Brettle
Administrator
Almost.  You need to copy the dll from the bin\Debug or bin\Release subfolder (whichever config you built).  The dll in the bin\ folder is just a copy of what was originally in the bin\Debug folder, so if you copy it you won't get the change.

Also, I'm not sure whether you need to restart IIS to pick up changes to 3rd-party assemblies.  You might want to just to be sure.

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Guest-26

Hi,

ok i tested it  x-times if he re-combiles the NeatIpload Project successfully.

Strange thing is, Visual Studio doesnt change the existing dlls in the originally \bin\debug or \bin\release folder, instead it is creating a new folder named "obj" and in this folder it is creating a "debug" folder with the new created Brettle.Web.NeatUpload.dll.

So i used this one and replaced it with the one i got in my project \bin folder and added it again as reference and recombiled everything.

Unfortunately no luck, the same error occurs...

Note 1: Btw, as i made the changing from

if (requestHandledBySubRequest)

to

if (false)

Visual Studio underlined

"HttpApplication" with the warning that a "unreachable code was found" but no error, just a warning, so i could compiled with np.

Note 2: Meanwhile i found out somethign strange, if i logged into my page and klick on anything, for example the submit button for uploading (no file is choosen!) and then pressing the Signout button and try to come back to this upload url, it works, he is refusing this site and redirecting to my login page...

atm im really confused why my signout is working only if im actually "doing/klicking" something on the upload page, doesnt matter what actually.

 

 

Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Dean Brettle
Administrator
Strange thing is, Visual Studio doesnt change the existing dlls in the originally \bin\debug or \bin\release folder, instead it is creating a new folder named "obj" and in this folder it is creating a "debug" folder with the new created Brettle.Web.NeatUpload.dll.

My bad.  Looking at NeatUpload.csproj, it looks like the OutputPath is set to \bin for both Debug and Release builds, so I suspect that the DLL that is directly in the bin\ directory is actually up-to-date.  You can check the timestamp to be sure.

So i used this one and replaced it with the one i got in my project \bin folder and added it again as reference and recombiled everything.

That sounds fine.

Unfortunately no luck, the same error occurs...

Bummer.  Well, I just got a free IIS/ASP.NET hosting account so that I can reproduce problems like yours that only occur in that environment.  I will be working on it tonight.

Note 1: Btw, as i made the changing from

if (requestHandledBySubRequest)

to

if (false)

Visual Studio underlined

"HttpApplication" with the warning that a "unreachable code was found" but no error, just a warning, so i could compiled with np.

That is expected.

Note 2: Meanwhile i found out somethign strange, if i logged into my page and klick on anything, for example the submit button for uploading (no file is choosen!) and then pressing the Signout button and try to come back to this upload url, it works, he is refusing this site and redirecting to my login page...

atm im really confused why my signout is working only if im actually "doing/klicking" something on the upload page, doesnt matter what actually.

Weird.  Can you confirm that the problem goes away if you remove the UploadHttpModule from your Web.config?  I expect it will, but I want to be sure.

--Dean

 

Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Guest-26

Oh dear, i think, i have to say Big sorry...

after i removed the NeatUpload Module, still the same error occurs...

something is wrong with my login mechanism in general... the Signout process doesnt seem to work correct...

im using the standard form based login for ASP... login works, but logout doesnt work if u just re-enter the url or press "back" at browser after LogOut is done...

strange...

sorry for the trouble :( 

Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload <form...>

Dean Brettle
Administrator
No worries.  Glad to hear that NeatUpload wasn't the culprit. :-)

I'm afraid I'm not sure what could be causing the SignOut() problem.

Best of luck,

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: SignOut() doesnt work within Upload &lt;form...&gt;

Guest-26

Hey, i was just looking thru this post. The reason why you are still able to access the restricted pages even after signing out is : when u signout and press the back button or copy and paste the url in browser, the page is served from the cache on the client machine and not from the server. If you just try to refresh this page, you'll be redirected to the login page.

Hope this helps...

Cheers,

Riz