Solved

Session timeout isnt working....

Posted on 2008-10-24
5
253 Views
Last Modified: 2013-11-26
I want the Users Session to timeout after 20 min.

i have set IIS6 to 20 min, i set my global.asax  to 20 min(see code)
and i have set my web.config (see below)

The session gets timed out in about 1 min, but i cant seem to find why?
Any ideas?

I am using SQL Server 2005 backend DB

Thank you inadvance.
GLOBAL.ASAX

   Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)

        ' Fires when the session is started

        Session.Timeout = 20

    End Sub

    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)

        ' Fires when the session ends

        Session.Abandon()

    End Sub
 

WEB.CONFIG

		<authentication mode="Forms">

			<forms name="MySite" loginUrl="Login.aspx" protection="All" timeout="20"></forms>

		</authentication>

Open in new window

0
Comment
Question by:16spam16
  • 3
5 Comments
 
LVL 1

Author Comment

by:16spam16
Comment Utility
I dont beleive this happens on my local testing PC, it happens once i deploy it t the server.  
So what that being said what in IIS, SQL Server, or my actual web app could be causing this?
Seems weird.
thank you in advance.
0
 
LVL 7

Expert Comment

by:ASPSQLServerCOM
Comment Utility
best comment out one by one, means first try only with session time out from config file, do you experience same preoblem, if yes then remove the web config session time out and keep only IIS session time out, you will come to know exactly where the problem is

also the session time out what you are trying is a sub directory , define session time out at the root website level
many times web site override the root setting.
0
 
LVL 1

Author Comment

by:16spam16
Comment Utility
Update...
I tried running my app from VS2008 on my local machince, but connecting to the production servers SQL DB...did not disconnect me.

SQL DB Eliminated as cause.

on my production server i have 1 other web app(3 small static websites and 1 FTP server) whose session works fine.
I THINK it must be in the setting s for that particular website.  

What should i check for in IIS?



0
 
LVL 26

Expert Comment

by:Anurag Thakur
Comment Utility
as far as i know DB is never a problem with serssion timeout

add this to your web.config
<sessionState timeout="30" />

modify the following
<authentication mode="Forms">
       <forms name="MySite" loginUrl="Login.aspx" protection="All" />
</authentication>

remove Session.Timeout = 20 from global.asax and try again
0
 
LVL 1

Accepted Solution

by:
16spam16 earned 0 total points
Comment Utility
i think i found my issue.

First, it isnt a session issue.
The reason no other site is having an issue is b/c they are all running unique Application Pools
I recall going in on the site in question, and changed the defaut values to like 1 min recycle on the Worker Process, thinking it would free up memory.  I never went back in and changed them back, b/c it doesnt really affect the memory that much with my app.  problem is i cant confirm this till monday, b/c i dont have access to that particular server remotely.  

Thanks.

I will confirm this monday morning.

Thank you.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now