Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 big problem with timing out

Author  Topic 

jhermiz

3564 Posts

Posted - 2004-11-03 : 11:47:28
in my web config file I have set this file up such that time out sessions dont expire for like 20 minutes...

However, this obviously has no effect at all...my application constantly times out forcing the user to relogin sometimes after 2-3 minutes.

In most of my page load events I do this:


If Session("Login") Is Nothing Then
'session timed out
Session("TimedOut") = "TRUE"
Response.Redirect("Login.aspx?ReturnURL=" & Server.UrlEncode(Request.Url.PathAndQuery))
Else
'good session
strLoginUser = Session("Login")
intClientID = Session("ClientID")
End If


Which works...but this is way too many timeouts...I mean a user can barely get his / her work done (I expect) If my app is constantly timing out. What do I need to do to maintain some sort of session here?

Thanks,
Jon

Kristen
Test

22859 Posts

Posted - 2004-11-03 : 14:00:18
Doesn't sound right, Jon. IIS should be giving your users a Session for 20 minutes (or whatever you set it to in the IIS Manager Tool) shouldn't it?

Kristen
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-11-03 : 15:29:37
Are you using Forms Authentication?

Can you post the web.config's SessionState and Authentication nodes? That would help answer a few questions that will help me answer yours.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-11-03 : 16:09:37
Complete web.config file...

Kristen Im not sure why it isn't...Michael yes it is Forms Authentication


<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- Custom Settings tailored for the IMS application
strConn = The Connection string
-->
<appSettings>
<add key="strConn" value="User ID=id1;Password=blah;Initial Catalog=db;Data Source=server;"/>
<add key="strAttachmentsPath" value="\\jakah-iis-2\IMS\attachments\"/>
</appSettings>
<!-- Settings for Web Services Threads
-->
<system.net>
<connectionManagement>
<add address="*" maxconnection="40" />
</connectionManagement>
</system.net>

<system.web>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="vb" debug="true"></compilation>

<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.

"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors mode="Off"/>

<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
its settings for the application. Anonymous access must be disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter their credentials, and then
you authenticate them in your application. A user credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member sites.
-->

<!-- We use Forms authentication to deny anonymous users
only authenticated users allowed to use the application.
If the user is not authenticated he / she is directed to the
'login.aspx' page by using the loginUrl property of the forms tag.
-->
<authentication mode="Forms">
<forms name=".IMSCookie" loginUrl="login.aspx" protection="All" path="/"/>
</authentication>

<!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users. We DO NOT place an authorization tag in the web.config file on the root
directory (this file) since we do not require end users to authenticate themselves to the files
residing in this directory.
-->
<authorization>
<deny users="?"/>
</authorization>


<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application.
Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
trace information will be displayed at the bottom of each page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your web application
root.
-->
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>


<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong to a particular session.
If cookies are not available, a session can be tracked by adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="60"/>

<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

</system.web>
<!-- Allow all users to see Login.aspx -->
<location path="login.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

<location path="forgotpwd.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

<location path="register.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>
Go to Top of Page

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2004-11-03 : 17:01:51
After you recompile the program does it force the user to relogin?

If so it is because when you recompile your dll's for your application change which forces the application to restart which clears out all your session information.
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-11-03 : 17:05:35
I think you need a timeout in your forms authentication as well.
I remember reading awhile back that Session timeout and Forms timeouts are not exactly "snyced up" so you could get logged out due to EITHER of them timing out.


<authentication mode="Forms">
<forms name=".IMSCookie" loginUrl="login.aspx" protection="All" path="/" timeout="60"/>
</authentication>



Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-11-03 : 17:07:55
is that in minutes or seconds michael? Im guessing if seconds we need 1200 ?

Jon
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-11-03 : 17:18:42
I believe it's minutes, just like the session timeout.
Well, let me say it like this. I have both my session and forms timeout's set to 20.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
   

- Advertisement -