Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Saturday, March 31, 2012

Session time-out,when the page breaks?

Hi..

I had published a website in the server( I am using VS 2005,ASP.NET2.0, With C#) . I tried testing the site by asking several users to login to the website and do unit testing. At one instance of time, the page breaks for a particular user. When the page breaks, the other users who are tesing in their machine are getting a session time-out and are forced to log out.

Why is such a session-time out issue happening, when one of the users page breaks. I have set the session variable to 20 minutes,which is the default. But what's confusing is , when one of the user's page breaks, the others get a session time-out? Why is such a session-time out occuring?

Please help.

Thanks.

What do you mean when you say "the page breaks?" If an app pool cycles you might see this effect. Have you diagnosed the "page break" to see what happens?

Jeff


Thank you very much for the reply.

The page break, I referred is the page crashing(asp.net error page) .I have customized the error page to show, An Unexpected error occurred, please try after some time.

But when the user tries the same steps to find the page crash, he is not able to, as the page works well. This is a kind of absurd. The page is not crashing always, but it is random. I checked the log, but it was not providing much information. I also could not re-trace the page crash, as the page worked well.

But why is the session getting timed out for the other users, when one of the users page crashes?

Thanks.


Hi..

I am sorry that I forgot to include a scenario in my web page,which i am doing. I have written a code to delete a folder in the session end in global.asax. When i commented the code, and tried testing, the session time out was not occuring.

I searched in the google, and came out with this:

http://www.velocityreviews.com/forums/t116975-all-session-are-getting-down-when-i-delete-sessions-folders.html

Is this the reason for all sessions getting timed-out, when a page crashes?

Thanks


Hi Venkatzeus,

As far as i know, if you delete a folder which is in your application directory, the appDomain will restart, and you will lose your session.

I hope this helps.


This happens as your worker process memory limits get full and asp.net worker process gets restarted. how to do this setting you can find at

http://www.asp.net/faq/AspNetAndIIS6.aspx

But I think you needs to findout why its getting full.

When you get this error check server CPU Usage what it shows?

then debug.


HI,,

Thank you very much for the reply. I will try with it and provide the results.

Thanks

session vaiables lost randomly

i am developing an asp.net web based application using javascript as the server side scripting language. The application makes constant use of an access database and session variables. in a random way, the session variables are lost causing the application to break. The only software on the xp-pro box is iis, .NET framework, office 2003 and 3 com objects: aspmail, aspimage and aspsmartupload. There is no virus detection software.

Anybody have an idea why the session variables are randomly lost ?

thanks, rich"i am developing an asp.net web based application using javascript as the
server side scripting language"
is this possible? What are you using to develope this? Better yet, why are
you using javascript as a serverside .NET language?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com

"rich00" <rich00@.discussions.microsoft.com> wrote in message
news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
> i am developing an asp.net web based application using javascript as the
server side scripting language. The application makes constant use of an
access database and session variables. in a random way, the session
variables are lost causing the application to break. The only software on
the xp-pro box is iis, .NET framework, office 2003 and 3 com objects:
aspmail, aspimage and aspsmartupload. There is no virus detection software.
> Anybody have an idea why the session variables are randomly lost ?
> thanks, rich
this application is a port from asp to asp.net

asp only suppoted basic or javascript. the choice of javacript over basic was easy.

"rich00" wrote:

> i am developing an asp.net web based application using javascript as the server side scripting language. The application makes constant use of an access database and session variables. in a random way, the session variables are lost causing the application to break. The only software on the xp-pro box is iis, .NET framework, office 2003 and 3 com objects: aspmail, aspimage and aspsmartupload. There is no virus detection software.
> Anybody have an idea why the session variables are randomly lost ?
> thanks, rich
jscript.net is a fine language, it only downside is lack of ide support.

anyway, lots of events trigger loss of session. any recompile of the app or
reload of the domain, cause session data to be lost with the inproc session
manager. check the event log form appdomain recycles.

if you want a stable site, you should not use inproc, but the sql session
manager (works with the free msde).

-- bruce (sqlwork.com)

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uA6taC$TEHA.3012@.tk2msftngp13.phx.gbl...
> "i am developing an asp.net web based application using javascript as the
> server side scripting language"
> is this possible? What are you using to develope this? Better yet, why are
> you using javascript as a serverside .NET language?
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
> "rich00" <rich00@.discussions.microsoft.com> wrote in message
> news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
> > i am developing an asp.net web based application using javascript as the
> server side scripting language. The application makes constant use of an
> access database and session variables. in a random way, the session
> variables are lost causing the application to break. The only software on
> the xp-pro box is iis, .NET framework, office 2003 and 3 com objects:
> aspmail, aspimage and aspsmartupload. There is no virus detection
software.
> > Anybody have an idea why the session variables are randomly lost ?
> > thanks, rich
>i am developing an asp.net web based application using javascript as the
>server side scripting language

wow, can i see that code please.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"rich00" <rich00@.discussions.microsoft.com> wrote in message
news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
>i am developing an asp.net web based application using javascript as the
>server side scripting language. The application makes constant use of an
>access database and session variables. in a random way, the session
>variables are lost causing the application to break. The only software on
>the xp-pro box is iis, .NET framework, office 2003 and 3 com objects:
>aspmail, aspimage and aspsmartupload. There is no virus detection software.
> Anybody have an idea why the session variables are randomly lost ?
> thanks, rich
the app consists of 1000+ scripts. i can send you a smple sctipt or 2. the app builds database driven web sites.

"Alvin Bruney [MVP]" wrote:

> >i am developing an asp.net web based application using javascript as the
> >server side scripting language
> wow, can i see that code please.
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "rich00" <rich00@.discussions.microsoft.com> wrote in message
> news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
> >i am developing an asp.net web based application using javascript as the
> >server side scripting language. The application makes constant use of an
> >access database and session variables. in a random way, the session
> >variables are lost causing the application to break. The only software on
> >the xp-pro box is iis, .NET framework, office 2003 and 3 com objects:
> >aspmail, aspimage and aspsmartupload. There is no virus detection software.
> > Anybody have an idea why the session variables are randomly lost ?
> > thanks, rich
>

session vaiables lost randomly

i am developing an asp.net web based application using javascript as the ser
ver side scripting language. The application makes constant use of an access
database and session variables. in a random way, the session variables are
lost causing the applicatio
n to break. The only software on the xp-pro box is iis, .NET framework, offi
ce 2003 and 3 com objects: aspmail, aspimage and aspsmartupload. There is no
virus detection software.
Anybody have an idea why the session variables are randomly lost ?
thanks, rich"i am developing an asp.net web based application using javascript as the
server side scripting language"
is this possible? What are you using to develope this? Better yet, why are
you using javascript as a serverside .NET language?
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"rich00" <rich00@.discussions.microsoft.com> wrote in message
news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
> i am developing an asp.net web based application using javascript as the
server side scripting language. The application makes constant use of an
access database and session variables. in a random way, the session
variables are lost causing the application to break. The only software on
the xp-pro box is iis, .NET framework, office 2003 and 3 com objects:
aspmail, aspimage and aspsmartupload. There is no virus detection software.
> Anybody have an idea why the session variables are randomly lost ?
> thanks, rich
this application is a port from asp to asp.net
asp only suppoted basic or javascript. the choice of javacript over basic wa
s easy.
"rich00" wrote:

> i am developing an asp.net web based application using javascript as the server si
de scripting language. The application makes constant use of an access database and
session variables. in a random way, the session variables are lost causing the appli
cat
ion to break. The only software on the xp-pro box is iis, .NET framework, office 2003 and 3
com objects: aspmail, aspimage and aspsmartupload. There is no virus detection software.[c
olor=darkred]
> Anybody have an idea why the session variables are randomly lost ?
> thanks, rich[/color]
jscript.net is a fine language, it only downside is lack of ide support.
anyway, lots of events trigger loss of session. any recompile of the app or
reload of the domain, cause session data to be lost with the inproc session
manager. check the event log form appdomain recycles.
if you want a stable site, you should not use inproc, but the sql session
manager (works with the free msde).
-- bruce (sqlwork.com)
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:uA6taC$TEHA.3012@.tk2msftngp13.phx.gbl...
> "i am developing an asp.net web based application using javascript as the
> server side scripting language"
> is this possible? What are you using to develope this? Better yet, why are
> you using javascript as a serverside .NET language?
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> Site: http://www.Darkfalz.com
> Blog: http://blog.Darkfalz.com
>
> "rich00" <rich00@.discussions.microsoft.com> wrote in message
> news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
> server side scripting language. The application makes constant use of an
> access database and session variables. in a random way, the session
> variables are lost causing the application to break. The only software on
> the xp-pro box is iis, .NET framework, office 2003 and 3 com objects:
> aspmail, aspimage and aspsmartupload. There is no virus detection
software.
>
>i am developing an asp.net web based application using javascript as the
>server side scripting language
wow, can i see that code please.
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"rich00" <rich00@.discussions.microsoft.com> wrote in message
news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
>i am developing an asp.net web based application using javascript as the
>server side scripting language. The application makes constant use of an
>access database and session variables. in a random way, the session
>variables are lost causing the application to break. The only software on
>the xp-pro box is iis, .NET framework, office 2003 and 3 com objects:
>aspmail, aspimage and aspsmartupload. There is no virus detection software.
> Anybody have an idea why the session variables are randomly lost ?
> thanks, rich
the app consists of 1000+ scripts. i can send you a smple sctipt or 2. the a
pp builds database driven web sites.
"Alvin Bruney [MVP]" wrote:

> wow, can i see that code please.
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "rich00" <rich00@.discussions.microsoft.com> wrote in message
> news:C0B5DB69-E5F5-4946-917A-CBE4ED71325B@.microsoft.com...
>
>

Session URL Formatting

Hello,

I have a problem with ASP.Net:

I have an ASP.Net application on a web farm, using SQL Server Session
State Management, running on Windows 2000 (IIS 5)
With session management on, a URL like the following is created:
https://mywebapp.com/(ts2t2uivrj3vx...cvg)/start.aspx
The problem I am having is that at some point within the web application
I have to pass this link to an outside server, which in turn,
will do some work and then post back to my application. However, the
outside application is URL Encoding my URL, which in turn,
causes the URL to look like:
mywebapp.com/(suyvga3bcnzwrljiaxdfud30)/vbvnet.aspx
This cannot be handled by IIS, and induces a "page cannot be displayed
error"; which in effect, causes the application to terminate.

Is there any way that we can trap this error and redirect to the appropriate
location so that the web application does terminate, or is there a way
we can prevent the brackets within this application.

Hope I explained this correctly.

Appreciate any help.

Regards,

Malcolm KlotzOne approach - not clean - you can catch the IIS error code 404 and then
handle the issue on a redirect page. Sorry, I can't think of anything
cleaner at the moment.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @. www.lulu.com/owc, Amazon.com etc
"Malcolm Klotz" <nonesuch23@.online.nospam> wrote in message
news:OvlaLxATFHA.2812@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I have a problem with ASP.Net:
> I have an ASP.Net application on a web farm, using SQL Server Session
> State Management, running on Windows 2000 (IIS 5)
> With session management on, a URL like the following is created:
> https://mywebapp.com/(ts2t2uivrj3vx...cvg)/start.aspx
> The problem I am having is that at some point within the web
> application
> I have to pass this link to an outside server, which in turn,
> will do some work and then post back to my application. However, the
> outside application is URL Encoding my URL, which in turn,
> causes the URL to look like:
> mywebapp.com/(suyvga3bcnzwrljiaxdfud30)/vbvnet.aspx
> This cannot be handled by IIS, and induces a "page cannot be displayed
> error"; which in effect, causes the application to terminate.
> Is there any way that we can trap this error and redirect to the
> appropriate
> location so that the web application does terminate, or is there a way
> we can prevent the brackets within this application.
> Hope I explained this correctly.
> Appreciate any help.
> Regards,
> Malcolm Klotz
Thanks for Alvin's inputs,

Hi Malcolm,

Since you are using the cookieless Session(embed sessionid in the url
string) in your web app, is there any particular requirement in your
scenario that we must use cookieless session? Is it possbile that we use
cookieenabled session instread?

Also, as for passing the url to a outside server, I think we have the
following means:

1. If we are forced to use cookieless session and with the sessionid
embeded in the url, I suggest that we filter the sessionid when pass the
url out to the remote server. For example:

when giving the following url

https://mywebapp.com/(ts2t2uivrj3vx...cvg)/start.aspx

we can use substring concating or regex to get the url without embeded
sessionid like:

https://mywebapp.com/start.aspx

this can also work for the remote requster, the only difference is that the
request with non-sessionid url will be unable to retrieve the data in the
SessionState associated with the id. Do you think this means possbile?

2. If we also want to let the remote server be able to retrieve the
sessiondata, I suggest that we still pass the urlstring without embeded
sessionid , but also pass the SessionId string as separate data to that
remote server together with the url string. How do you think of this?

Please feel free to post here if you have any other questions or ideas.
Thanks,

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Thank you, you have given me a place to start.

"Steven Cheng[MSFT]" <v-schang@.online.microsoft.com> wrote in message
news:eSJz3kGTFHA.2476@.TK2MSFTNGXA01.phx.gbl...
> Thanks for Alvin's inputs,
> Hi Malcolm,
> Since you are using the cookieless Session(embed sessionid in the url
> string) in your web app, is there any particular requirement in your
> scenario that we must use cookieless session? Is it possbile that we use
> cookieenabled session instread?
> Also, as for passing the url to a outside server, I think we have the
> following means:
> 1. If we are forced to use cookieless session and with the sessionid
> embeded in the url, I suggest that we filter the sessionid when pass the
> url out to the remote server. For example:
> when giving the following url
> https://mywebapp.com/(ts2t2uivrj3vx...cvg)/start.aspx
> we can use substring concating or regex to get the url without embeded
> sessionid like:
> https://mywebapp.com/start.aspx
> this can also work for the remote requster, the only difference is that
the
> request with non-sessionid url will be unable to retrieve the data in the
> SessionState associated with the id. Do you think this means possbile?
> 2. If we also want to let the remote server be able to retrieve the
> sessiondata, I suggest that we still pass the urlstring without embeded
> sessionid , but also pass the SessionId string as separate data to that
> remote server together with the url string. How do you think of this?
> Please feel free to post here if you have any other questions or ideas.
> Thanks,
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
You're welcome Malcolm,

Good luck! :-)

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Thursday, March 29, 2012

Session URL Formatting

Hello,
I have a problem with ASP.Net:
I have an ASP.Net application on a web farm, using SQL Server Session
State Management, running on Windows 2000 (IIS 5)
With session management on, a URL like the following is created:
https://mywebapp.com/(ts2t2uivrj3vxg452ah33cvg)/start.aspx
The problem I am having is that at some point within the web application
I have to pass this link to an outside server, which in turn,
will do some work and then post back to my application. However, the
outside application is URL Encoding my URL, which in turn,
causes the URL to look like:
mywebapp.com/(suyvga3bcnzwrljiaxdfud30)/vbvnet.aspx
This cannot be handled by IIS, and induces a "page cannot be displayed
error"; which in effect, causes the application to terminate.
Is there any way that we can trap this error and redirect to the appropriate
location so that the web application does terminate, or is there a way
we can prevent the brackets within this application.
Hope I explained this correctly.
Appreciate any help.
Regards,
Malcolm KlotzOne approach - not clean - you can catch the IIS error code 404 and then
handle the issue on a redirect page. Sorry, I can't think of anything
cleaner at the moment.
Regards,
Alvin Bruney - ASP.NET MVP
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @. www.lulu.com/owc, Amazon.com etc
"Malcolm Klotz" <nonesuch23@.online.nospam> wrote in message
news:OvlaLxATFHA.2812@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I have a problem with ASP.Net:
> I have an ASP.Net application on a web farm, using SQL Server Session
> State Management, running on Windows 2000 (IIS 5)
> With session management on, a URL like the following is created:
> https://mywebapp.com/(ts2t2uivrj3vxg452ah33cvg)/start.aspx
> The problem I am having is that at some point within the web
> application
> I have to pass this link to an outside server, which in turn,
> will do some work and then post back to my application. However, the
> outside application is URL Encoding my URL, which in turn,
> causes the URL to look like:
> mywebapp.com/(suyvga3bcnzwrljiaxdfud30)/vbvnet.aspx
> This cannot be handled by IIS, and induces a "page cannot be displayed
> error"; which in effect, causes the application to terminate.
> Is there any way that we can trap this error and redirect to the
> appropriate
> location so that the web application does terminate, or is there a way
> we can prevent the brackets within this application.
> Hope I explained this correctly.
> Appreciate any help.
> Regards,
> Malcolm Klotz
>
Thanks for Alvin's inputs,
Hi Malcolm,
Since you are using the cookieless Session(embed sessionid in the url
string) in your web app, is there any particular requirement in your
scenario that we must use cookieless session? Is it possbile that we use
cookieenabled session instread?
Also, as for passing the url to a outside server, I think we have the
following means:
1. If we are forced to use cookieless session and with the sessionid
embeded in the url, I suggest that we filter the sessionid when pass the
url out to the remote server. For example:
when giving the following url
https://mywebapp.com/(ts2t2uivrj3vxg452ah33cvg)/start.aspx
we can use substring concating or regex to get the url without embeded
sessionid like:
https://mywebapp.com/start.aspx
this can also work for the remote requster, the only difference is that the
request with non-sessionid url will be unable to retrieve the data in the
SessionState associated with the id. Do you think this means possbile?
2. If we also want to let the remote server be able to retrieve the
sessiondata, I suggest that we still pass the urlstring without embeded
sessionid , but also pass the SessionId string as separate data to that
remote server together with the url string. How do you think of this?
Please feel free to post here if you have any other questions or ideas.
Thanks,
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Thank you, you have given me a place to start.
"Steven Cheng[MSFT]" <v-schang@.online.microsoft.com> wrote in message
news:eSJz3kGTFHA.2476@.TK2MSFTNGXA01.phx.gbl...
> Thanks for Alvin's inputs,
> Hi Malcolm,
> Since you are using the cookieless Session(embed sessionid in the url
> string) in your web app, is there any particular requirement in your
> scenario that we must use cookieless session? Is it possbile that we use
> cookieenabled session instread?
> Also, as for passing the url to a outside server, I think we have the
> following means:
> 1. If we are forced to use cookieless session and with the sessionid
> embeded in the url, I suggest that we filter the sessionid when pass the
> url out to the remote server. For example:
> when giving the following url
> https://mywebapp.com/(ts2t2uivrj3vxg452ah33cvg)/start.aspx
> we can use substring concating or regex to get the url without embeded
> sessionid like:
> https://mywebapp.com/start.aspx
> this can also work for the remote requster, the only difference is that
the
> request with non-sessionid url will be unable to retrieve the data in the
> SessionState associated with the id. Do you think this means possbile?
> 2. If we also want to let the remote server be able to retrieve the
> sessiondata, I suggest that we still pass the urlstring without embeded
> sessionid , but also pass the SessionId string as separate data to that
> remote server together with the url string. How do you think of this?
> Please feel free to post here if you have any other questions or ideas.
> Thanks,
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
You're welcome Malcolm,
Good luck! :-)
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Session var lost using InProc or StateServer mode

On my development machine my application works fine but on the
deployment server my session variable gets lost after a postback on a
webform. By doing a watch on the Session object I can see that the
SessionId is changing and the mode is StateServer. (I changed from
InProc to StateServer to try to fix the problem but it didn't have any
effect.
Details:
- Win 2k Server/IIS 5.0/.NET Framework 1.1
- I have disabled virus protection.
- The StateServer service is running.
Any ideas are greatly appreciated.
MichaelIs there an underscore character ("_") in the name of your deployment
server? There's a known bug in that case.
--
John Saunders
johnwsaundersiii at hotmail
"MG" <kloodge@.yahoo.com> wrote in message
news:8be4d6f4.0407081008.ed2152f@.posting.google.com...
> On my development machine my application works fine but on the
> deployment server my session variable gets lost after a postback on a
> webform. By doing a watch on the Session object I can see that the
> SessionId is changing and the mode is StateServer. (I changed from
> InProc to StateServer to try to fix the problem but it didn't have any
> effect.
> Details:
> - Win 2k Server/IIS 5.0/.NET Framework 1.1
> - I have disabled virus protection.
> - The StateServer service is running.
> Any ideas are greatly appreciated.
> Michael
Yes there is. Thanks for the insight !!!
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Session var lost using InProc or StateServer mode

On my development machine my application works fine but on the
deployment server my session variable gets lost after a postback on a
webform. By doing a watch on the Session object I can see that the
SessionId is changing and the mode is StateServer. (I changed from
InProc to StateServer to try to fix the problem but it didn't have any
effect.

Details:
- Win 2k Server/IIS 5.0/.NET Framework 1.1
- I have disabled virus protection.
- The StateServer service is running.

Any ideas are greatly appreciated.

MichaelIs there an underscore character ("_") in the name of your deployment
server? There's a known bug in that case.
--
John Saunders
johnwsaundersiii at hotmail

"MG" <kloodge@.yahoo.com> wrote in message
news:8be4d6f4.0407081008.ed2152f@.posting.google.co m...
> On my development machine my application works fine but on the
> deployment server my session variable gets lost after a postback on a
> webform. By doing a watch on the Session object I can see that the
> SessionId is changing and the mode is StateServer. (I changed from
> InProc to StateServer to try to fix the problem but it didn't have any
> effect.
> Details:
> - Win 2k Server/IIS 5.0/.NET Framework 1.1
> - I have disabled virus protection.
> - The StateServer service is running.
> Any ideas are greatly appreciated.
> Michael
Yes there is. Thanks for the insight !!!

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Monday, March 26, 2012

Session variable got lost after I switched to another server

The scenario is the following: from the login page I set a session variable
like
Session["USERID"]=3;
Server.transfer("anotherpage.aspx");
In anotherpage.aspx in page load I check to see if that Session is null, if
it's not show a javascript message window with the ID. The funny thing is
that the window is open, ->the variable gets to this page. Good, untill now!
If I click a button from this anotherpage.aspx to
Server.transfer(clients.aspx) and in clients.aspx I try to acces the
Session["USERID"] it says that it is gone (I mean if I cast to string type,
the resulting value is null).
Now the boom (for me) At work (Win 2000) this used to work, however when I
transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
What happens to that variable'Can you write out the value of your session id to make sure it is not
changing between postbacks?
"Vlady" wrote:

> The scenario is the following: from the login page I set a session variabl
e
> like
> Session["USERID"]=3;
> Server.transfer("anotherpage.aspx");
> In anotherpage.aspx in page load I check to see if that Session is null, i
f
> it's not show a javascript message window with the ID. The funny thing is
> that the window is open, ->the variable gets to this page. Good, untill no
w!
> If I click a button from this anotherpage.aspx to
> Server.transfer(clients.aspx) and in clients.aspx I try to acces the
> Session["USERID"] it says that it is gone (I mean if I cast to string type
,
> the resulting value is null).
> Now the boom (for me) At work (Win 2000) this used to work, however when I
> transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
> What happens to that variable'

Session variable got lost after I switched to another server

The scenario is the following: from the login page I set a session variable
like
Session["USERID"]=3;
Server.transfer("anotherpage.aspx");
In anotherpage.aspx in page load I check to see if that Session is null, if
it's not show a javascript message window with the ID. The funny thing is
that the window is open, ->the variable gets to this page. Good, untill now!
If I click a button from this anotherpage.aspx to
Server.transfer(clients.aspx) and in clients.aspx I try to acces the
Session["USERID"] it says that it is gone (I mean if I cast to string type,
the resulting value is null).
Now the boom (for me) At work (Win 2000) this used to work, however when I
transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
What happens to that variable??Can you write out the value of your session id to make sure it is not
changing between postbacks?

"Vlady" wrote:

> The scenario is the following: from the login page I set a session variable
> like
> Session["USERID"]=3;
> Server.transfer("anotherpage.aspx");
> In anotherpage.aspx in page load I check to see if that Session is null, if
> it's not show a javascript message window with the ID. The funny thing is
> that the window is open, ->the variable gets to this page. Good, untill now!
> If I click a button from this anotherpage.aspx to
> Server.transfer(clients.aspx) and in clients.aspx I try to acces the
> Session["USERID"] it says that it is gone (I mean if I cast to string type,
> the resulting value is null).
> Now the boom (for me) At work (Win 2000) this used to work, however when I
> transfered at my house (WinXP Pro SP 1 with all updates) it doesn't!!!!
> What happens to that variable??

Saturday, March 24, 2012

Session Variable question

Hi everyone,

I am trying to extract data out of a SQL Server database (data looks like this:http://svrxblcyadnet02/crimp/CRIMP_Report_Frame.asp?) and plug it into a session variable. Below is the code I've come up with so far. My question is this: How do you get the data from the Dataset to the session variable? Thanks

privatevoid GetData()

{

string ConnectionString = "server=MyServer;uid=Sphynx;pwd=letmein;database=MyDatabase";

string CommandText = "select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM = 'CRIMP_strName'";

SqlConnection myConnection =new SqlConnection(ConnectionString);

SqlDataAdapter myCommand =new SqlDataAdapter(CommandText, myConnection);

DataSet ds =new DataSet();

myCommand.Fill(ds);

Session["varString"] = "??"; //? What goes here?

myConnection.Close();

}

Ds.Tables(0).Rows(0)("ordnum")

Session can hold any object. You can store your dataset this way!

Session["myData"] = ds;

When you try to access the data, you need to do this

if (Session["myData"] != null)
DataSet ds = (DataSet) Session["myData"];

If you want store the values of the dataset, you use

ds.Tables[0].Rows[0][columnno]

HTH


Well almost any object. Depends if the Session is InProc or stored in the state server or SQL Server. In which case the the object would have to be serializable. It is also worth mentioning that DataSets can be stored in Session while DataRows can't.


batman++:


Depends if the Session is InProc or stored in the state server or SQL Server. In which case the the object would have to be serializable.

Thanks batman! I missed that :)


I get the following error then I run it:

Object reference not set to an instance of an object.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 41: Line 42:Line 43: Session["varString"] = ds.Tables["CRIMP_Common_Lookup"].Rows[0][2].ToString();Line 44: myConnection.Close();Line 45:


The error indicates that there is nothing in the 3rd column of the first row of the table CRIMP_Common_Lookup. Without the code used to populate the DataSet, all I can tell you is that either the table doesn't exist OR there are no rows in that table OR the value in the column is null. If you are using vs2005 start debugging, set a break point on a line just before the error and use the DataSet visualizer to check the contents. Otherwise the you can just add an if clause to check for null before adding it to Session.

Sorry, I see your SQL now.

select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM = 'CRIMP_strName'";

Make sure that LOOKUP_DS is the 3rd column in the table. You can also use Rows[0]["LOOKUP_DS"].ToString().

Also you might want to set the table name in the Fill() method.

myCommand.Fill(ds, "CRIMP_common_lookup");

C# is case sensative even though sql usually is not.


Thanks guys,

I used batman++ last reply and it fixed the problem.

Fix ==> Also you might want to set the table name in the Fill() method.

myCommand.Fill(ds, "CRIMP_common_lookup");


Are you sure, that this statement is working fine?

select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM = 'CRIMP_strName'";

I guess CRIMP_strName is a variable, but you have included it in the string. It should be like this..

select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM ='" + CRIMP_strName + "'";

If you are going to store only one table in the dataset, then its not madatory to give the table name!. C# doesnt look for SQL case sensitiveness!

Thanks


Thanks e_screw,

Although my SQL definition works: (

select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM = 'CRIMP_strName'";

), yours lookes more appropriate: (select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM ='" + CRIMP_strName + "'";)

On another note, how would I write the code to use a DataReader instead of a DataSet? How would you rewrite the following code to reflect the DataReader?


private void GetData()

{

string ConnectionString = "server=MyServer;uid=Sphynx;pwd=letmein;database=MyDatabase";

string CommandText = "select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM = '" + CRIMP_strName + "'";

SqlConnection myConnection = new SqlConnection(ConnectionString);

SqlDataAdapter myCommand = new SqlDataAdapter(CommandText, myConnection);

DataSet ds = new DataSet();

myCommand.Fill(ds, "CRIMP_common_lookup");

Session["varString"] = ds.Tables["CRIMP_Common_Lookup"].Rows[0][2].ToString();
myConnection.Close();

}

Thanks!


This will be the code to use SqlDataReader instead of DataSet. When you set the command text to the adapter, by default it will be SelectCommand. So we call the ExecuteReader on the selectCommand of the sqlDataAdapter. If you want to close the connection, you need to use the CommandBehavior.CloseConnection in ExecuteReader method.

1private void GetData() {2string ConnectionString ="server=MyServer;uid=Sphynx;pwd=letmein;database=MyDatabase";3string CommandText ="select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM = '" + CRIMP_strName +"'";45 SqlConnection myConnection =new SqlConnection(ConnectionString);6 SqlDataAdapter myCommand =new SqlDataAdapter(CommandText, myConnection);7 SqlDataReader myReader = myCommand.SelectCommand.ExecuteReader();8while (myReader.Read()) {9 Session["varString"] = myReader["CRIMP_Common_Lookup"].ToString();10 }11// myConnection.Close(); or CommandBehavior.CloseConnection12}13
HTH

How do you specify which row and column to read the data from?

e_screw,

what did you do when you copy and paste code with line number? I haven't figure out how to include the line number.

If you can give me a hint how to do that I will really appreciate!

Sue

e_screw:

This will be the code to use SqlDataReader instead of DataSet. When you set the command text to the adapter, by default it will be SelectCommand. So we call the ExecuteReader on the selectCommand of the sqlDataAdapter. If you want to close the connection, you need to use the CommandBehavior.CloseConnection in ExecuteReader method.

1private void GetData() {2string ConnectionString ="server=MyServer;uid=Sphynx;pwd=letmein;database=MyDatabase";3string CommandText ="select LOOKUP_DS from CRIMP_COMMON_LOOKUP where LOOKUP_NM = '" + CRIMP_strName +"'";45 SqlConnection myConnection =new SqlConnection(ConnectionString);6 SqlDataAdapter myCommand =new SqlDataAdapter(CommandText, myConnection);7 SqlDataReader myReader = myCommand.SelectCommand.ExecuteReader();8while (myReader.Read()) {9 Session["varString"] = myReader["CRIMP_Common_Lookup"].ToString();10 }11// myConnection.Close(); or CommandBehavior.CloseConnection12}13
HTH


When you are using SqlDataReader, we use the .Read() method, to read the rows returned.myReader.Read() reads all the rows in the reader. In a particular row, you can directly access the column by its name or ordinal.myReader["fieldName"] or myReader[0] gets you the required column.

while(myReader.Read()) {
string name = myReader["name"].ToString();
}

This will read the fieldname "name" for each row returned.

Thanks

session variables

I have always done something similar, and found it the best way to go
(when weighing functionality against server resources). The only
suggestion that might be of use is instead of having numerous session
variables, you could slimline it by creating an user object (containing
user id, and user info, etc.) and then store that object in a session
variable.Is there a way to send a popup message when the session expires and to
automatically send the user back to the logon page? Thanks.

Tuesday, March 13, 2012

session variables and controls

I'm looking at three options and need advice.
Assuming these pages will have a large amount of users at any time

Option 1:(least server intensive, in my opinion)
Page loads a large TreeView populated from a database SPROC
In each node is a URL link that when clicked opens a new page and populates the information on that page from another SPROC.
Basically the treeview is only loaded once but I'm not thrilled about opening a new window when a node is clicked.

Option 2: Page Loads the TreeView same as above but each node calls the same page with a querystring that loads the new information.
Problem is that all Postbacks and non-postbacks require reloading the TreeView (More hits to the database, unless it retrieves from cache?)

Option 3: Page Loads TreeView same as above but stores the TreeView in a session variable-This works in that after the first hit the TreeView is always repopulated from the session version of the TreeView. (No more hits to the database) Ok...well if each person has a session variable of a TreeView is this a large memory resource? Is a session of a largly populated TreeView extremely more memory intensive than say a session of a string?

What would be considered more resourse intensive, consecutive hits to the database or one large session variable per user hit.

Anyone who can shed some light on this or even offer some alternatives would be great! Thanks.look into viewstate as another option perhaps. Just check MSDN or search on here or google about viewstate
Da bomb. there are a ton of different examples out there: google ajax.

http://webui30.componentart.com/callback/features/ajax_treeViewContent/WebForm1.aspx
ASP.NET caching can allow you to cache the dataset for that treeview control, to which you can bind everytime. If it doesn't exist, then only would you need to retrieve it from the database.
mendhak,
I came up with the idea to store the treeview in a session variable.
The first hit to the database populates the treeview and also gets stored to the session variable. ie: session("mytreeview")
When the page is reloaded it checks the session state and reloads the treeview from the session and not the database. So that solves the database getting hit consecutivly. Is this what you mean by cacheing, if not what technique would you use to accomplish this?
As I understand it viewstate is sent back as a hidden element in the form so in my thinking viewstate probably takes as much resourse as the session version I created, but I don't know for sure. They both could get very large depending on how many nodes your treeview has. Mine is quite large and I'm expecting a large volume of users so my quest is to keep things at a minimum with maximum results. Ideally I should load my treeview in one page and then the nodes would open a new window meaning the treeview would ever get loaded once per page hit, but ideally I want to recall the page from the nodes to populate a multiview, I actually have it all working just really curious as to ideas and best techniques for keeping the load on the server at a minimum. THX, GT
No, what you're doing is actually worse than storing it in ViewState. For each user, a session variable would be created, and so that'd increase server load.

Here, read about .NET Data Caching:

http://aspnet.4guysfromrolla.com/articles/100902-1.aspx
Thanks that worked out nicely. I didn't feel easy with what I came up with which is why I posted the question, I knew that I was creating server load, I just wasn't sure what is considered acceptable usage and would be ok.
The cache being shared by all users makes a great deal more sense and makes me feel alot better about server load and a application that can stand up to heavy usage. Thanks again.

Session variables and frames

hi Bonj,
You are confusing server side and client side, the Page_Load event occur in
the server side, the objects from the client side (frames, documents,
windows, etc ) do not exist.
If your header page decide the content of the main page you need to
implement that functionality there, you can do so in different ways, if the
page to load & its parameters are decided in the server, then you have to
send this info back to the browser, where a script can read it and set the
correct src of the main frame. the other way to do it is if when you load
the header you can decide what the possible source of main page will be you
can use LinkButtons for example with the correct properties value set.
regarding your doubs about global/session variables:
> If I use a global variable, will it be guaranteed to have a unique value
in the memory of the web server for each user?
there are not global variables, they need to be either in
Session/Application collections or as a static member of a class used, in
anyway its value will be shared among ALL the users of the application

> If I use a session variable, will it be reliable enough to be guaranteed
not to have been "relegated out of the session" by the time the property
between the <%= ... %> comes to read >it?
A session variable will exist as long as the session exist, it will never
happen that a variable exist when you start processing the page and timeout
before you finish processing it, the only way to end a session is either you
call Session.Abandon or a page is not requested in a given timeframe.
Hope this help,
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Bonj" <anonymous@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:D773F097-099A-46C4-AB6A-B83E29CC3E83@dotnet.itags.org.microsoft.com...
> Hi
> I've got the following problem - I need to have an aspx page with two
frames, although the question isn't necessarily about the workings of the
frames, more session variables... the frames consist of one header (not
resizable) and one main (resizable). The source for the "main" page needs to
be of the form "WebForm3.aspx?..." with parameters to be determined at
runtime. I'm ok with this, I've gone down the route of putting
> src="http://pics.10026.com/?src=<%= MainPageToDisplay %>"
> but what about MainPageToDisplay - the info it needs to access can only be
decided in the Page_Load event - so I was wondering which out of a global
variable and a session variable are the most reliable to store this
information, for instance my dilemma is as such:
> If I use a global variable, will it be guaranteed to have a unique value
in the memory of the web server for each user?
> If I use a session variable, will it be reliable enough to be guaranteed
not to have been "relegated out of the session" by the time the property
between the <%= ... %> comes to read it?
> Thanks for any help, would really appreciate this one clearing up!
> Thanks.> regarding your doubs about global/session variables:
> in the memory of the web server for each user?
> there are not global variables, they need to be either in
> Session/Application collections or as a static member of a class used, in
> anyway its value will be shared among ALL the users of the application
Are the class member declared as static shared among ALL the users of
the application?
As far as I understand objects declared in a session scope shouldn't
be shared among ALL users.
Where can I read more info about it?
What should I do to declare and initialize object once per user and
this object shouldn't be shared among other users?
I'm going with it being undefined - i.e. can't guarantee them to be unique,
can't guarantee them to be shared.

Session Variables and SSL

Hi Al,

Got over the issue on passing variabels on to a page on an SSL server.......

but heres the question...can I use ... a session variable going form https://www.mysite.com/page1.aspx to https://www.mysite.com/page2.aspx

do they work as long as I saty in the same domain ont he same server in the ssl folder?

rgs

Tonysession variable going form https://www.mysite.com/page1.aspx to https://www.mysite.com/page2.aspx ?

Yes, Session variables will work in above problem.

As session variables are maintained by server So it will work in same server.

Session variables disappear

Hi all,

We have a small problem.

We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
farm, on a single server, using in-proc session state, only using one worker
process.

The problem is that at seemingly random times, some of the session variables
return as if set to nothing.

We are using session variables to pass small objects from one page request
to the next. Which seems to work perfectly most of the time, but as I said
above, at random times, some but not all of the session variables return as
nothing.

Anyone any ideas?

Thanks in advance and Regards,
Simon.This is hard to diagnose without a lot of context information, but here is a
suggestion:

Try switching to cookieless for a while and see if the problem persists. If
not, then it may be some sort of cookie issue. The only other thing to be
aware of is that IIS process recycling will force you to lose session state.
The IIS settings on that may be too aggressive.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Simon" wrote:

> Hi all,
> We have a small problem.
> We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
> farm, on a single server, using in-proc session state, only using one worker
> process.
> The problem is that at seemingly random times, some of the session variables
> return as if set to nothing.
> We are using session variables to pass small objects from one page request
> to the next. Which seems to work perfectly most of the time, but as I said
> above, at random times, some but not all of the session variables return as
> nothing.
> Anyone any ideas?
> Thanks in advance and Regards,
> Simon.
>
check the event log for asp.net recycles - these will clear inproc sessions.
(real production servers should not use inproc sessions for this reason)

-- bruce (sqlwork.com)

"Simon" <s@.v.c> wrote in message
news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
> Hi all,
> We have a small problem.
> We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
> farm, on a single server, using in-proc session state, only using one
> worker process.
> The problem is that at seemingly random times, some of the session
> variables return as if set to nothing.
> We are using session variables to pass small objects from one page request
> to the next. Which seems to work perfectly most of the time, but as I said
> above, at random times, some but not all of the session variables return
> as nothing.
> Anyone any ideas?
> Thanks in advance and Regards,
> Simon.
You can use performance monitor to see how often .NET application restarts.
When it does so all sessions are lost.

Couple reasons why application would restart.

1. new version of DLL was uploaded into BIN folder.
2. More than 15 aspx files were updated/added (15 is configurable value but
by default it's 15).
3. Folder in the project directory was created/removed.
4. There is antivirus active on the machine. Although it will not modify
aspx files it will trigger same sequence as it would. (See #2)
5. The application hanged or reached it's memory limit.

Also check eventlog there might be something in there especially if you have
case #5.

George.

"Simon" <s@.v.c> wrote in message
news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
> Hi all,
> We have a small problem.
> We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
> farm, on a single server, using in-proc session state, only using one
> worker process.
> The problem is that at seemingly random times, some of the session
> variables return as if set to nothing.
> We are using session variables to pass small objects from one page request
> to the next. Which seems to work perfectly most of the time, but as I said
> above, at random times, some but not all of the session variables return
> as nothing.
> Anyone any ideas?
> Thanks in advance and Regards,
> Simon.
Thanks for the reply,

What would you suggest we use instead of inproc.
We have looked at sqlserver, but all objects that you put in session must be
serializable, which some of them aren't

Thanks,
Simon.

"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:%23uIZxwBLGHA.3064@.TK2MSFTNGP10.phx.gbl...
> check the event log for asp.net recycles - these will clear inproc
> sessions. (real production servers should not use inproc sessions for this
> reason)
> -- bruce (sqlwork.com)
> "Simon" <s@.v.c> wrote in message
> news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
>> Hi all,
>>
>> We have a small problem.
>>
>> We are running an ASP.NET1.1 application, using IIS6 on server2003, no
>> web farm, on a single server, using in-proc session state, only using one
>> worker process.
>>
>> The problem is that at seemingly random times, some of the session
>> variables return as if set to nothing.
>>
>> We are using session variables to pass small objects from one page
>> request to the next. Which seems to work perfectly most of the time, but
>> as I said above, at random times, some but not all of the session
>> variables return as nothing.
>>
>> Anyone any ideas?
>>
>> Thanks in advance and Regards,
>> Simon.
>>
Thanks for the reply George,

Surely if the application restarts, then all current sessions will end and
all session variables will disappear which we test for at the start of each
page load.

The problems occur after it has already returned several session items, and
then one of them comes back as nothing.

Perhaps the application is restarting mid request? is that possible? or is
it possible that objects can get GC'd when in session?

Regards,
Simon.

"George Ter-Saakov" <gt-nsp@.cardone.com> wrote in message
news:OToPtBCLGHA.536@.TK2MSFTNGP09.phx.gbl...
> You can use performance monitor to see how often .NET application
> restarts.
> When it does so all sessions are lost.
> Couple reasons why application would restart.
> 1. new version of DLL was uploaded into BIN folder.
> 2. More than 15 aspx files were updated/added (15 is configurable value
> but by default it's 15).
> 3. Folder in the project directory was created/removed.
> 4. There is antivirus active on the machine. Although it will not modify
> aspx files it will trigger same sequence as it would. (See #2)
> 5. The application hanged or reached it's memory limit.
> Also check eventlog there might be something in there especially if you
> have case #5.
>
>
> George.
>
> "Simon" <s@.v.c> wrote in message
> news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
>> Hi all,
>>
>> We have a small problem.
>>
>> We are running an ASP.NET1.1 application, using IIS6 on server2003, no
>> web farm, on a single server, using in-proc session state, only using one
>> worker process.
>>
>> The problem is that at seemingly random times, some of the session
>> variables return as if set to nothing.
>>
>> We are using session variables to pass small objects from one page
>> request to the next. Which seems to work perfectly most of the time, but
>> as I said above, at random times, some but not all of the session
>> variables return as nothing.
>>
>> Anyone any ideas?
>>
>> Thanks in advance and Regards,
>> Simon.
>>

Session variables disappear

Hi all,
We have a small problem.
We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
farm, on a single server, using in-proc session state, only using one worker
process.
The problem is that at seemingly random times, some of the session variables
return as if set to nothing.
We are using session variables to pass small objects from one page request
to the next. Which seems to work perfectly most of the time, but as I said
above, at random times, some but not all of the session variables return as
nothing.
Anyone any ideas?
Thanks in advance and Regards,
Simon.This is hard to diagnose without a lot of context information, but here is a
suggestion:
Try switching to cookieless for a while and see if the problem persists. If
not, then it may be some sort of cookie issue. The only other thing to be
aware of is that IIS process recycling will force you to lose session state.
The IIS settings on that may be too aggressive.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Simon" wrote:

> Hi all,
> We have a small problem.
> We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
> farm, on a single server, using in-proc session state, only using one work
er
> process.
> The problem is that at seemingly random times, some of the session variabl
es
> return as if set to nothing.
> We are using session variables to pass small objects from one page request
> to the next. Which seems to work perfectly most of the time, but as I said
> above, at random times, some but not all of the session variables return a
s
> nothing.
> Anyone any ideas?
> Thanks in advance and Regards,
> Simon.
>
>
check the event log for asp.net recycles - these will clear inproc sessions.
(real production servers should not use inproc sessions for this reason)
-- bruce (sqlwork.com)
"Simon" <s@.v.c> wrote in message
news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
> Hi all,
> We have a small problem.
> We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
> farm, on a single server, using in-proc session state, only using one
> worker process.
> The problem is that at seemingly random times, some of the session
> variables return as if set to nothing.
> We are using session variables to pass small objects from one page request
> to the next. Which seems to work perfectly most of the time, but as I said
> above, at random times, some but not all of the session variables return
> as nothing.
> Anyone any ideas?
> Thanks in advance and Regards,
> Simon.
>
You can use performance monitor to see how often .NET application restarts.
When it does so all sessions are lost.
Couple reasons why application would restart.
1. new version of DLL was uploaded into BIN folder.
2. More than 15 aspx files were updated/added (15 is configurable value but
by default it's 15).
3. Folder in the project directory was created/removed.
4. There is antivirus active on the machine. Although it will not modify
aspx files it will trigger same sequence as it would. (See #2)
5. The application hanged or reached it's memory limit.
Also check eventlog there might be something in there especially if you have
case #5.
George.
"Simon" <s@.v.c> wrote in message
news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
> Hi all,
> We have a small problem.
> We are running an ASP.NET1.1 application, using IIS6 on server2003, no web
> farm, on a single server, using in-proc session state, only using one
> worker process.
> The problem is that at seemingly random times, some of the session
> variables return as if set to nothing.
> We are using session variables to pass small objects from one page request
> to the next. Which seems to work perfectly most of the time, but as I said
> above, at random times, some but not all of the session variables return
> as nothing.
> Anyone any ideas?
> Thanks in advance and Regards,
> Simon.
>
Thanks for the reply,
What would you suggest we use instead of inproc.
We have looked at sqlserver, but all objects that you put in session must be
serializable, which some of them aren't
Thanks,
Simon.
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:%23uIZxwBLGHA.3064@.TK2MSFTNGP10.phx.gbl...
> check the event log for asp.net recycles - these will clear inproc
> sessions. (real production servers should not use inproc sessions for this
> reason)
> -- bruce (sqlwork.com)
> "Simon" <s@.v.c> wrote in message
> news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
>
Thanks for the reply George,
Surely if the application restarts, then all current sessions will end and
all session variables will disappear which we test for at the start of each
page load.
The problems occur after it has already returned several session items, and
then one of them comes back as nothing.
Perhaps the application is restarting mid request? is that possible? or is
it possible that objects can get GC'd when in session?
Regards,
Simon.
"George Ter-Saakov" <gt-nsp@.cardone.com> wrote in message
news:OToPtBCLGHA.536@.TK2MSFTNGP09.phx.gbl...
> You can use performance monitor to see how often .NET application
> restarts.
> When it does so all sessions are lost.
> Couple reasons why application would restart.
> 1. new version of DLL was uploaded into BIN folder.
> 2. More than 15 aspx files were updated/added (15 is configurable value
> but by default it's 15).
> 3. Folder in the project directory was created/removed.
> 4. There is antivirus active on the machine. Although it will not modify
> aspx files it will trigger same sequence as it would. (See #2)
> 5. The application hanged or reached it's memory limit.
> Also check eventlog there might be something in there especially if you
> have case #5.
>
>
> George.
>
> "Simon" <s@.v.c> wrote in message
> news:43e8835f$0$82636$ed2619ec@.ptn-nntp-reader03.plus.net...
>