calling asp.net mvc action method using jquery post method expires the session
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'开发者_JS百科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
I think problem is with permission on the folder where you've created the Zip file.
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
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.
精彩评论