Print Page | Close Window

Session data lost

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=27493
Printed Date: 02 April 2026 at 2:29pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Session data lost
Posted By: evans
Subject: Session data lost
Date Posted: 26 June 2009 at 11:13am
Symptoms
1. CAPTCHA tells that entered security incorrect in any case.
2. Registering user with turned off CAPTCHA - forums tells that access is denied and aborts user creation.
3. Script kinda:
<% ' Display the Session.Contents collection. 
  Response.Write Session.Contents.Count & " items are in Session.Contents collection:<HR>" 
  Dim sessItem 
  For Each sessItem In Session.Contents 
    If IsArray(Session.Contents.Item(sessItem)) Then 
      Response.write sessItem & " : an array of the following " _ 
& UBound(Session.Contents.Item(sessItem))+1 & " items <BR>" 
      For each objArray in Session.Contents.Item(sessItem) 
        Response.write "- " & objArray & "<BR>" 
      Next 
    ElseIf IsObject(Session.Contents.Item(sessItem)) Then 
      Response.write(sessItem & " : Session object cannot be displayed." & "<BR>") 
    Else 
      Response.write(sessItem & " : " & CStr(Session.Contents.Item(sessItem)) & "<BR>") 
    End If 
  Next  
%>
Tells that: 0 items are in Session.Contents collection:

Situation:
Single server, IIS 6.0, Application pool is loner, session timeout is 20 min. IIS have rights. 
MsSQL DB used, 2k3 server

Solution: Up to you. Urgently needed Dead



Replies:
Posted By: WebWiz-Bruce
Date Posted: 26 June 2009 at 11:30am
It looks like your server is not holding ASP sessions.

You mention that you have only 1 application pool, make sure that this application pool is running in a single worker process (Web Garden in IIS 6) otherwise it will not hold sessions.

You may want to place your forum in a virtual directory in IIS and then give that virtual directory it's own application pool, making sure that it is using just a single worker process and set it to recycle just once a day.

The command prompt is also useful to tell if your application pools are running in a single process. Type iisapp in your command prompt and it will show you all the application pools running on the server. If an app pool has multiple worker processes it will be listed multiple times.

You can also use iisapp at the command prompt to see if the app pool is recycling. Next to each app pool there is a PID number, if when you run iisapp again this number has changed then the application pool has recycled dropping any session data stored in it.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: evans
Date Posted: 26 June 2009 at 12:11pm
You're right.
>iisapp
(PID) W3WP.exe: 5572   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 6876   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 3700   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 4372   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 3796   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 5672   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 7620   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 7612   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 2520   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 6380   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 6316   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 956   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 2680   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 5928   AppPoolId: DefaultAppPool
(PID) W3WP.exe: 3432   AppPoolId: DefaultAppPool
How to force application pool to use single process? (Meh beh newbie meh now know %( )


Posted By: evans
Date Posted: 26 June 2009 at 12:59pm
Oh. My sorry. WebGarden = 1 and everything is fine :)


Posted By: WebWiz-Bruce
Date Posted: 26 June 2009 at 2:10pm
Instead of having a single application pool with lots of worker processes like you had, you might instead want to look at creating an application pool for each website you have on the server each with a single worker process.

This would give you improved stability and security while still allowing sessions to work.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net