views:

251

answers:

3

hi,

i have a website where i provicde a link. On clicking the link a controller action method is called to generate a zip file after creation of zip file is done, i show the link to download the zip file by replacing the link to create a zip with the link to download the zip.

the problem is that after zip file creation is over and link is shown, when user clicks on the link to download the zip file, they are sent to login. After providing correct credentials in the login page they are prompted to download the zip file. they sould not be sent to the login page. In the action to generate zip file i haven't abondoned the session or haven't not done anything that abondons the session.

the user should not be sen't to login page after successful creation of zip file user should be able to download the file without login.

i search internet on this problem, but i did not find any solution. In one of the blog written by hanselman i found this statement that creates the problem with the session: Is some other thing like an Ajax call or IE's Content Advisor simultaneously hitting the default page or login page and causing a race condition that calls Session.Abandon? (It's happened before!)

so i thought there might be some problem with ajax call that causes the session to expire, but i don't know what is happening?

any help

please

thanks

A: 

I think problem is with permission on the folder where you've created the Zip file.

Shyama
A: 

The Session has nothing to do with access to ressources.

If a prompt is shown to login it means that the resource that the user wants to donwload is protect by FormsAuthenication or WindowsAuthentication.

If you dont want this, then check the Authorisation section in web.config.

Malcolm Frexner
even if don't click the link to download and click other links on the web page, i get the login.
nccsbim071
Does this happen on your local development webserver, local iis or on a production webserver?
Malcolm Frexner
it happens both while debugging in visual studio and on production server. i have already hosted the website, and yes it happens even there.
nccsbim071
In this post http://www.hanselman.com/blog/TroubleshootingExpiredASPNETSessionStateAndYourOptions.aspx under troubleshooting section Scott Hanselman has written this: Is some other thing like an Ajax call or IE's Content Advisor simultaneously hitting the default page or login page and causing a race condition that calls Session.Abandon? (It's happened before!)
nccsbim071
i am using jquery post method to call the controller action to create zip file.
nccsbim071
+1  A: 

hi, guys i found the solution to this problem. The problem was like this: I created a zip file in application folder and in .net 2.0 it is a rule that any change to the application files and folder causes the session to expire. As soon i created the zip file in the directory somewhere other than directory in application folder, everything worked fine.

anyways thanks

nccsbim071