Solved

Session timeout isnt working....

Posted on 2008-10-24
5
261 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
ID: 22801262
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
ID: 22801907
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
ID: 22803233
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
ID: 22803838
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
ID: 22807300
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Regular expression help 2 25
ASP.NET MVC -Add authentication 2 21
SQL Error - Query 6 25
Call Controller Action Method from ASPX 2 15
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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