Reputation: 777
When I upload file (ex. photo), I'm loosing user session, web-site redirects me to the login page. I'm uploading files in a different folder, not in project's folder.
Web.config, system.web:
<system.web>
<authentication mode="Forms">
<forms defaultUrl="/" loginUrl="/Account/Login" name="_User" timeout="60" path="/" />
</authentication>
<sessionState mode="InProc" timeout="60" />
<compilation targetFramework="4.7" />
<httpRuntime targetFramework="4.7" executionTimeout="3600" maxRequestLength="52428" />
<globalization culture="en-US" uiCulture="en-US" fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" responseHeaderEncoding="utf-8" />
<customErrors mode="Off" defaultRedirect="/" redirectMode="ResponseRedirect" />
</system.web>
Any idea?
Upvotes: 0
Views: 81
Reputation: 66641
Always set the domain in the cookies, and form, and preferable with out the www.
so the cookies can work even if the user or the url did not include it.
<httpCookies domain="domain.com" />
<forms domain="domain.com" />
This is one of the possible issue - Other can be the requireSSL
field.
Upvotes: 1