Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Saturday, March 31, 2012

Session Timeout.

Friends,
We have a simple application which has login page, users login to it
and enter their contact details and all other stuff. It is working
fine. Now we have moved to new windows 2003 server. The page works
but it gets refreshed every 5 mintues and goes back to login.aspx page.
How do I fix this.
Thanks for any help.
KAdd this in your Web.config file to elongate Session to 60min for example:
<sessionState cookieless="UseCookies" mode="InProc" timeout="60" />
but add it between
<system.web> </system.web>
--
Bishoy George
bishoy@.bishoy.com
20102550399
"Sai" <kumar877@.gmail.com> wrote in message
news:1145074352.770881.44720@.u72g2000cwu.googlegroups.com...
> Friends,
> We have a simple application which has login page, users login to it
> and enter their contact details and all other stuff. It is working
> fine. Now we have moved to new windows 2003 server. The page works
> but it gets refreshed every 5 mintues and goes back to login.aspx page.
> How do I fix this.
> Thanks for any help.
> K
>
no that did not help. same thing is happening again.
Do you have code in your page to redirect to your login page? Sounds like
your session is timing out and your code is kicking in to repost. Write some
code in your session_end event handler to dump a file with a time-stamp to
tell you when the session is dying. You can trouble-shoot from there.
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
----
"Sai" <kumar877@.gmail.com> wrote in message
news:1145116360.101576.258960@.i40g2000cwc.googlegroups.com...
> no that did not help. same thing is happening again.
>
Hi Alvin,
thanks for the advise. Iam inputting the values to a text file when
session times out. It is coming as 60 seconds. So the session is
timing out at every 60 seconds, but I could not find where to change
these value. I checked the web.config and machine.config and
application pools .
Let me know specific place to change this value.
thanks,
K
So you have an override somewhere in your code because the timeout value is
20 minutes by default. Search your code for that value. Alternatively, it
may be overridden in the web.config file. As a quick test, you can set
session.timeout = 10 minutes. It should stick otherwise, you have something
funky going on in your app that you either don't know about or aren't
sharing.
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
----
"Sai" <kumar877@.gmail.com> wrote in message
news:1145288352.456543.4650@.t31g2000cwb.googlegroups.com...
> Hi Alvin,
> thanks for the advise. Iam inputting the values to a text file when
> session times out. It is coming as 60 seconds. So the session is
> timing out at every 60 seconds, but I could not find where to change
> these value. I checked the web.config and machine.config and
> application pools .
> Let me know specific place to change this value.
> thanks,
> K
>
Nothing in the code, nothing in the web.config. It has to be some
other place. I have seen all my code and no where I am setting these
values.
I tried changing session timeout to 10 minutes and still nothing
happens. So it got to be some where, not that simple.
Where else it can be.?
Thanks.
K
you need that check. go back and put it in there so that your application
can be resilient to memory issues. However, raise the limit to around 1gig
or so. The reason for this is that the application pool should be recycled
if an errant application (your code) decides to hog memory. Removing that
check prevents detection of this and other conditions.
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
----
"Sai" <kumar877@.gmail.com> wrote in message
news:1145306983.181641.177810@.i40g2000cwc.googlegroups.com...
> Thanks for all your help. It got fixed just now. The problem is
> Virtual memory was so low (250MB), so every time a worker process
> initiates it goes to 250 MB and it recycles, so what we did was, we
> just removed the check box next to virtual memory of application pool.
> that's it. It works...great relief.
> Thanks,
> K
>
Thanks for all your help. It got fixed just now. The problem is
Virtual memory was so low (250MB), so every time a worker process
initiates it goes to 250 MB and it recycles, so what we did was, we
just removed the check box next to virtual memory of application pool.
that's it. It works...great relief.
Thanks,
K
Where is the Virtual memory checked/set? Somewhere in IIS?
Ron

Session Timeout.

Friends,

We have a simple application which has login page, users login to it
and enter their contact details and all other stuff. It is working
fine. Now we have moved to new windows 2003 server. The page works
but it gets refreshed every 5 mintues and goes back to login.aspx page.
How do I fix this.

Thanks for any help.

KAdd this in your Web.config file to elongate Session to 60min for example:

<sessionState cookieless="UseCookies" mode="InProc" timeout="60" /
but add it between
<system.web> </system.web>
--

Bishoy George
bishoy@.bishoy.com
20102550399

--------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145074352.770881.44720@.u72g2000cwu.googlegro ups.com...
> Friends,
> We have a simple application which has login page, users login to it
> and enter their contact details and all other stuff. It is working
> fine. Now we have moved to new windows 2003 server. The page works
> but it gets refreshed every 5 mintues and goes back to login.aspx page.
> How do I fix this.
> Thanks for any help.
> K
no that did not help. same thing is happening again.
Do you have code in your page to redirect to your login page? Sounds like
your session is timing out and your code is kicking in to repost. Write some
code in your session_end event handler to dump a file with a time-stamp to
tell you when the session is dying. You can trouble-shoot from there.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145116360.101576.258960@.i40g2000cwc.googlegr oups.com...
> no that did not help. same thing is happening again.
Hi Alvin,

thanks for the advise. Iam inputting the values to a text file when
session times out. It is coming as 60 seconds. So the session is
timing out at every 60 seconds, but I could not find where to change
these value. I checked the web.config and machine.config and
application pools .

Let me know specific place to change this value.

thanks,
K
So you have an override somewhere in your code because the timeout value is
20 minutes by default. Search your code for that value. Alternatively, it
may be overridden in the web.config file. As a quick test, you can set
session.timeout = 10 minutes. It should stick otherwise, you have something
funky going on in your app that you either don't know about or aren't
sharing.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145288352.456543.4650@.t31g2000cwb.googlegrou ps.com...
> Hi Alvin,
> thanks for the advise. Iam inputting the values to a text file when
> session times out. It is coming as 60 seconds. So the session is
> timing out at every 60 seconds, but I could not find where to change
> these value. I checked the web.config and machine.config and
> application pools .
> Let me know specific place to change this value.
> thanks,
> K
Nothing in the code, nothing in the web.config. It has to be some
other place. I have seen all my code and no where I am setting these
values.
I tried changing session timeout to 10 minutes and still nothing
happens. So it got to be some where, not that simple.
Where else it can be.?

Thanks.
K
Thanks for all your help. It got fixed just now. The problem is
Virtual memory was so low (250MB), so every time a worker process
initiates it goes to 250 MB and it recycles, so what we did was, we
just removed the check box next to virtual memory of application pool.
that's it. It works...great relief.

Thanks,
K
you need that check. go back and put it in there so that your application
can be resilient to memory issues. However, raise the limit to around 1gig
or so. The reason for this is that the application pool should be recycled
if an errant application (your code) decides to hog memory. Removing that
check prevents detection of this and other conditions.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145306983.181641.177810@.i40g2000cwc.googlegr oups.com...
> Thanks for all your help. It got fixed just now. The problem is
> Virtual memory was so low (250MB), so every time a worker process
> initiates it goes to 250 MB and it recycles, so what we did was, we
> just removed the check box next to virtual memory of application pool.
> that's it. It works...great relief.
> Thanks,
> K
Where is the Virtual memory checked/set? Somewhere in IIS?

Ron
it's under one of the application pool health monitoring tabs in IIS

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"RonL" <sal_paradise_93@.yahoo.com> wrote in message
news:1145322157.561147.218050@.j33g2000cwa.googlegr oups.com...
> Where is the Virtual memory checked/set? Somewhere in IIS?
> Ron
I couldn't find it. I see you're talking about Windows 2003 and I'm
looking at IIS 5 and XP Pro on my local machine.

Ron
IIS 5 doesn't have these characteristics. sorry.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"RonL" <sal_paradise_93@.yahoo.com> wrote in message
news:1145411388.245339.46900@.i40g2000cwc.googlegro ups.com...
>I couldn't find it. I see you're talking about Windows 2003 and I'm
> looking at IIS 5 and XP Pro on my local machine.
> Ron

Session tracked via URL in ASP.NET

Hello,

I have my asp.net web application to track session id across pages using the url, and not cookies, ie in the web.config file:
<sessionState .... cookieless="true" ...... />

however each link in the page does not embed the id in the url like it is supposed to :

<a href="http://links.10026.com/?link=http://mywebserver/(rqe4ptb333ojxz3kh1t3xqr3)/mypage.aspx"> my link </a>

and so each page i travel to, a new session id is created in the url and the information associated with the previous page's session id is lost.

can anybody tell me what else i need to do to make this work?

thank you,

Kenton Taylorfor some reason the .net framework will not insert the session id before rendering the HTML if your HREF uses a "/" to denote that the path is relative to the root

this will work:
href="http://myserver/home.aspx"

as will this:
href="home.aspx"

but this won't:
href="/home.aspx"

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 Values are lost

Hello everyone,

I have a problem I have no idea why it happens.
I have an ASP.NET application that has around 7 forms.
To move from one form to another I use "redirect".
I also use around 12 Session items that I fill with different values
like for ex.: Session.item("EmployeeName")="LILIA"
98% of the time everything is OK.
However once "in a blue moon" I find that the value in
Session.item("EmployeeName") is lost.
I am sure is not an expiration time since this happens after only a
couple of minutes.
Any help will be very much appreciated.

Thanks,

LilianaIf you are convinced that it isn't the timout its almost for sure that the
application gets restarted for some reason.
Causes are editing wec.config,gloval.asax,...

Cheers,
Tom Pester

> Hello everyone,
> I have a problem I have no idea why it happens.
> I have an ASP.NET application that has around 7 forms.
> To move from one form to another I use "redirect".
> I also use around 12 Session items that I fill with different values
> like for ex.: Session.item("EmployeeName")="LILIA"
> 98% of the time everything is OK.
> However once "in a blue moon" I find that the value in
> Session.item("EmployeeName") is lost.
> I am sure is not an expiration time since this happens after only a
> couple of minutes.
> Any help will be very much appreciated.
> Thanks,
> Liliana
You must be sure follow issues:
1.Would you modify your application's bin directory.
2.May be your aspnet_wp.exe(in window2000 or xp) was recycled.
--
Help you,Help me.

"LiliA" wrote:

> Hello everyone,
> I have a problem I have no idea why it happens.
> I have an ASP.NET application that has around 7 forms.
> To move from one form to another I use "redirect".
> I also use around 12 Session items that I fill with different values
> like for ex.: Session.item("EmployeeName")="LILIA"
> 98% of the time everything is OK.
> However once "in a blue moon" I find that the value in
> Session.item("EmployeeName") is lost.
> I am sure is not an expiration time since this happens after only a
> couple of minutes.
> Any help will be very much appreciated.
> Thanks,
> Liliana
>

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!

Session Variable

I have an application where the default page requires the user to choose the location they are logging into. I take the value (one or two letter designation) and save it to a Session variable. I then access this variable on the page load of all pages in the application and use the value to call stored procedures to display the proper data from the database. The problem is, some users are timing out and lose their session causing them to have to go back to the first page and re-choose their location. I did increase the session timeout to 60 but this may still not be long enough for some users. Is there a better way to do this without using a session variable? Any help and/or example VB code will be appreciated.

Thanks

While navigating to other page assign this value to a hidden field. Then afterwards check the value of hidden field instead of Session variable. Once you are navigating to another page transfer this value in hidden field again to Session.

Let me know if you need any further help


Any session var or app var would be subject to a session timeout. You do not want to extend the timeout too much because it has an adverse effect in resource consumption.

If your security requirements are not too stringent (risk is low), you could use a QueryString (URL) parameter instead. Validate the parameter to make sure nothing fishy comes in before you use it. You could keep the info in a user database and get the data from there when the user first logs in.


Forgot: You could also use Hidden fields (if security is not stringent) or cokkies if accepted in your client browsers.

See:http://msdn2.microsoft.com/en-us/library/z1hkazw7.aspx


I tried the suggestion and am now running into a problem. It works great if the user stays on the same page. The problem is when the user clicks on another page using the link buttons I provide. If the session expires then my variables are not set. I was hoping to set the Session Variables again when the user leaves the page but I'm not sure where to do this. Any more ideas?

What I would recommend is that you use a cookie for your application with a time-out of however many minutes you think you need. Each page would then check the cookie to get the values needed. With those wonderful people, such as myself, that don't allow most cookies, you can always make the page auto-refresh every x number of minutes. That should reset the timer on the session variable. You will have the problem of needing to make sure that data is not resubmitted. Web applications have the drawback of not automatically trusting the user the way a desktop application would.

Monday, March 26, 2012

Session variable losing value

I have an asp.net web application that uses session variables to store
user information (username, security areas, configuration data). When
the user logs into the system I store all of this information in a
class and then dump it into a session variable. The timeout on the
server is set to 2hrs. Every now and then (5min-30min) the web server
will lose the session variable. This is very inconsistent and doesn't
appear to have an associated pattern. Has anyone else come across this
issue and determined the root cause?
I've found a lot of posts that describe this issue but none that
actually pinpoint the cause or solution.

Please don't recommend that I use cookies, some other solution or
question why I'm storing this information in a session variable. The
application is structured in this way to meet specific user/regulatory
requirements and user imposed constraints.

Thanks!
NateAre you sure that the user keeps interacting with your web site for 2 hrs
after he logs in? Typically, I guess you maintain one session class object
per user and populates this class once the user logs in. Once the user
terminates his session (by logging out and closing the browser), it is lost.
That is how a session is defined logically.

"Nate Spillson" <nateusenet@.spillson.com> wrote in message
news:1ce32cdf.0308060908.7944a2b@.posting.google.co m...
> I have an asp.net web application that uses session variables to store
> user information (username, security areas, configuration data). When
> the user logs into the system I store all of this information in a
> class and then dump it into a session variable. The timeout on the
> server is set to 2hrs. Every now and then (5min-30min) the web server
> will lose the session variable. This is very inconsistent and doesn't
> appear to have an associated pattern. Has anyone else come across this
> issue and determined the root cause?
> I've found a lot of posts that describe this issue but none that
> actually pinpoint the cause or solution.
> Please don't recommend that I use cookies, some other solution or
> question why I'm storing this information in a session variable. The
> application is structured in this way to meet specific user/regulatory
> requirements and user imposed constraints.
> Thanks!
> Nate
It really depends on what you mean by "logging out and closing the browser".
If there is code to call Session.Abandon() in the sign out code, then yes,
this ends the session. But you don't know if there is.

Simply closing the browser does not end the session. The session continues
until the timeout.

However, any new browser instances will create a new session - while the
original one is still alive until the timeout occurrs.

Things that can occur an applications restart:
1) chaging DLL's, web.config, etc on the server
2) certain antivirus scanners that scan the above files, thus triggering a
restart

"Rao TRN" <trn_study@.hotmail.com> wrote in message
news:%23cJ6n9DXDHA.2620@.TK2MSFTNGP09.phx.gbl...
> Are you sure that the user keeps interacting with your web site for 2 hrs
> after he logs in? Typically, I guess you maintain one session class object
> per user and populates this class once the user logs in. Once the user
> terminates his session (by logging out and closing the browser), it is
lost.
> That is how a session is defined logically.
> "Nate Spillson" <nateusenet@.spillson.com> wrote in message
> news:1ce32cdf.0308060908.7944a2b@.posting.google.co m...
> > I have an asp.net web application that uses session variables to store
> > user information (username, security areas, configuration data). When
> > the user logs into the system I store all of this information in a
> > class and then dump it into a session variable. The timeout on the
> > server is set to 2hrs. Every now and then (5min-30min) the web server
> > will lose the session variable. This is very inconsistent and doesn't
> > appear to have an associated pattern. Has anyone else come across this
> > issue and determined the root cause?
> > I've found a lot of posts that describe this issue but none that
> > actually pinpoint the cause or solution.
> > Please don't recommend that I use cookies, some other solution or
> > question why I'm storing this information in a session variable. The
> > application is structured in this way to meet specific user/regulatory
> > requirements and user imposed constraints.
> > Thanks!
> > Nate

Session variable lost between pages

Here is a very interesting scenario.

I have a simple test application that loads a page and sets a session
variable on the load event. On the first page there is a link to a second
page. The load event of the second page displays the value of the session
variable.

The problem is that when I use a W2k machine, this little test works
perfect. Session variable value is displayed on the second page. However,
when I use my XPPro machine, the session variable is lost and nothing is
displayed.

Same version of IE. Same ASP.NET server. Just a different browser. I have
already played around with the privacy settings with no success. I am not
suspect of the server at this point, because the w2k computer works fine.

Any thoughts would be appreciated.

Thanks,
Marc.Are you sure that the session state setting is enabled within IIS? Although
ASP.Net may be setup the same, and the application settings may be the same,
the IIS settings themselves are a little different between IIS 5.0 and 5.1.
Session state usually starts with the web server itself and then it goes
down to ASP/ASP.Net so I would suspect IIS first, then the ASP/ASP.Net
settings second.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
news:%23zZfnswoDHA.2528@.TK2MSFTNGP10.phx.gbl...
> Here is a very interesting scenario.
> I have a simple test application that loads a page and sets a session
> variable on the load event. On the first page there is a link to a second
> page. The load event of the second page displays the value of the session
> variable.
> The problem is that when I use a W2k machine, this little test works
> perfect. Session variable value is displayed on the second page.
However,
> when I use my XPPro machine, the session variable is lost and nothing is
> displayed.
> Same version of IE. Same ASP.NET server. Just a different browser. I
have
> already played around with the privacy settings with no success. I am not
> suspect of the server at this point, because the w2k computer works fine.
> Any thoughts would be appreciated.
> Thanks,
> Marc.
Thanks Mark.

There is only one server that I am hitting from two different browsers,
therefore I believe the problems lies within the browser since the server is
the same.

Session state is enabled on the server.

Marc.

"Mark Fitzpatrick" <markfitz@.fitzme.com> wrote in message
news:OmPw$vxoDHA.2588@.tk2msftngp13.phx.gbl...
> Are you sure that the session state setting is enabled within IIS?
Although
> ASP.Net may be setup the same, and the application settings may be the
same,
> the IIS settings themselves are a little different between IIS 5.0 and
5.1.
> Session state usually starts with the web server itself and then it goes
> down to ASP/ASP.Net so I would suspect IIS first, then the ASP/ASP.Net
> settings second.
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - FrontPage
> "Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
> news:%23zZfnswoDHA.2528@.TK2MSFTNGP10.phx.gbl...
> > Here is a very interesting scenario.
> > I have a simple test application that loads a page and sets a session
> > variable on the load event. On the first page there is a link to a
second
> > page. The load event of the second page displays the value of the
session
> > variable.
> > The problem is that when I use a W2k machine, this little test works
> > perfect. Session variable value is displayed on the second page.
> However,
> > when I use my XPPro machine, the session variable is lost and nothing is
> > displayed.
> > Same version of IE. Same ASP.NET server. Just a different browser. I
> have
> > already played around with the privacy settings with no success. I am
not
> > suspect of the server at this point, because the w2k computer works
fine.
> > Any thoughts would be appreciated.
> > Thanks,
> > Marc.
I am away from my computer with VS .Net, so I can't check, but as I recall
there are different methods for persisting the session variables. I think
one of them uses cookies. Is it possible that is the method being used for
your site and that the computer losing the session variables does not accept
cookies.

"Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
news:OxrfxcyoDHA.2512@.TK2MSFTNGP09.phx.gbl...
> Thanks Mark.
> There is only one server that I am hitting from two different browsers,
> therefore I believe the problems lies within the browser since the server
is
> the same.
> Session state is enabled on the server.
> Marc.
>
> "Mark Fitzpatrick" <markfitz@.fitzme.com> wrote in message
> news:OmPw$vxoDHA.2588@.tk2msftngp13.phx.gbl...
> > Are you sure that the session state setting is enabled within IIS?
> Although
> > ASP.Net may be setup the same, and the application settings may be the
> same,
> > the IIS settings themselves are a little different between IIS 5.0 and
> 5.1.
> > Session state usually starts with the web server itself and then it goes
> > down to ASP/ASP.Net so I would suspect IIS first, then the ASP/ASP.Net
> > settings second.
> > Hope this helps,
> > Mark Fitzpatrick
> > Microsoft MVP - FrontPage
> > "Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
> > news:%23zZfnswoDHA.2528@.TK2MSFTNGP10.phx.gbl...
> > > Here is a very interesting scenario.
> > > > I have a simple test application that loads a page and sets a session
> > > variable on the load event. On the first page there is a link to a
> second
> > > page. The load event of the second page displays the value of the
> session
> > > variable.
> > > > The problem is that when I use a W2k machine, this little test works
> > > perfect. Session variable value is displayed on the second page.
> > However,
> > > when I use my XPPro machine, the session variable is lost and nothing
is
> > > displayed.
> > > > Same version of IE. Same ASP.NET server. Just a different browser.
I
> > have
> > > already played around with the privacy settings with no success. I am
> not
> > > suspect of the server at this point, because the w2k computer works
> fine.
> > > > Any thoughts would be appreciated.
> > > > Thanks,
> > > Marc.
> >
Have completed disabled the privacy settings on the computer losing the
session variable. My thinking was the same that it must be related to
cookies, but this has not helped.

Marc.

"William F. LaMartin" <lamartin@.ix.netcom.com> wrote in message
news:%23OUS6h1oDHA.372@.TK2MSFTNGP11.phx.gbl...
> I am away from my computer with VS .Net, so I can't check, but as I recall
> there are different methods for persisting the session variables. I think
> one of them uses cookies. Is it possible that is the method being used
for
> your site and that the computer losing the session variables does not
accept
> cookies.
>
> "Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
> news:OxrfxcyoDHA.2512@.TK2MSFTNGP09.phx.gbl...
> > Thanks Mark.
> > There is only one server that I am hitting from two different browsers,
> > therefore I believe the problems lies within the browser since the
server
> is
> > the same.
> > Session state is enabled on the server.
> > Marc.
> > "Mark Fitzpatrick" <markfitz@.fitzme.com> wrote in message
> > news:OmPw$vxoDHA.2588@.tk2msftngp13.phx.gbl...
> > > Are you sure that the session state setting is enabled within IIS?
> > Although
> > > ASP.Net may be setup the same, and the application settings may be the
> > same,
> > > the IIS settings themselves are a little different between IIS 5.0 and
> > 5.1.
> > > Session state usually starts with the web server itself and then it
goes
> > > down to ASP/ASP.Net so I would suspect IIS first, then the ASP/ASP.Net
> > > settings second.
> > > > Hope this helps,
> > > Mark Fitzpatrick
> > > Microsoft MVP - FrontPage
> > > > "Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
> > > news:%23zZfnswoDHA.2528@.TK2MSFTNGP10.phx.gbl...
> > > > Here is a very interesting scenario.
> > > > > > I have a simple test application that loads a page and sets a
session
> > > > variable on the load event. On the first page there is a link to a
> > second
> > > > page. The load event of the second page displays the value of the
> > session
> > > > variable.
> > > > > > The problem is that when I use a W2k machine, this little test works
> > > > perfect. Session variable value is displayed on the second page.
> > > However,
> > > > when I use my XPPro machine, the session variable is lost and
nothing
> is
> > > > displayed.
> > > > > > Same version of IE. Same ASP.NET server. Just a different browser.
> I
> > > have
> > > > already played around with the privacy settings with no success. I
am
> > not
> > > > suspect of the server at this point, because the w2k computer works
> > fine.
> > > > > > Any thoughts would be appreciated.
> > > > > > Thanks,
> > > > Marc.
> > > > > >
I have found the answer and am posting it here to help anyone else avoid my
pain! So simple is the answer. ZoneAlarm Pro.

It seems that using any of the privacy settings in ZoneAlarmPro cause some
very unusual problems with asp.net. Zonealarm was consuming the cookies
causing the session to be reset on each postback. I have disabled the
privacy settings and everything is back to normal. In doing some research
on the web, I have read the Norton and Blackice do not create this problem.
This is something I will be doing more research into to confirm it for
myself.

My advice to all is when experiencing any problem with asp.net the first
thing you should do is disable virus and firewall software. Hopefully this
is advice I will remember next time myself. It is very easy to have a
problem consume you to the point where you forget the simple basic things.

Marc.

"Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
news:OqX7C44oDHA.1496@.TK2MSFTNGP11.phx.gbl...
> Have completed disabled the privacy settings on the computer losing the
> session variable. My thinking was the same that it must be related to
> cookies, but this has not helped.
> Marc.
>
> "William F. LaMartin" <lamartin@.ix.netcom.com> wrote in message
> news:%23OUS6h1oDHA.372@.TK2MSFTNGP11.phx.gbl...
> > I am away from my computer with VS .Net, so I can't check, but as I
recall
> > there are different methods for persisting the session variables. I
think
> > one of them uses cookies. Is it possible that is the method being used
> for
> > your site and that the computer losing the session variables does not
> accept
> > cookies.
> > "Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
> > news:OxrfxcyoDHA.2512@.TK2MSFTNGP09.phx.gbl...
> > > Thanks Mark.
> > > > There is only one server that I am hitting from two different
browsers,
> > > therefore I believe the problems lies within the browser since the
> server
> > is
> > > the same.
> > > > Session state is enabled on the server.
> > > > Marc.
> > > > > > "Mark Fitzpatrick" <markfitz@.fitzme.com> wrote in message
> > > news:OmPw$vxoDHA.2588@.tk2msftngp13.phx.gbl...
> > > > Are you sure that the session state setting is enabled within IIS?
> > > Although
> > > > ASP.Net may be setup the same, and the application settings may be
the
> > > same,
> > > > the IIS settings themselves are a little different between IIS 5.0
and
> > > 5.1.
> > > > Session state usually starts with the web server itself and then it
> goes
> > > > down to ASP/ASP.Net so I would suspect IIS first, then the
ASP/ASP.Net
> > > > settings second.
> > > > > > Hope this helps,
> > > > Mark Fitzpatrick
> > > > Microsoft MVP - FrontPage
> > > > > > "Marc Rivait" <marcr@.rivaitsoftware.com> wrote in message
> > > > news:%23zZfnswoDHA.2528@.TK2MSFTNGP10.phx.gbl...
> > > > > Here is a very interesting scenario.
> > > > > > > > I have a simple test application that loads a page and sets a
> session
> > > > > variable on the load event. On the first page there is a link to
a
> > > second
> > > > > page. The load event of the second page displays the value of the
> > > session
> > > > > variable.
> > > > > > > > The problem is that when I use a W2k machine, this little test
works
> > > > > perfect. Session variable value is displayed on the second page.
> > > > However,
> > > > > when I use my XPPro machine, the session variable is lost and
> nothing
> > is
> > > > > displayed.
> > > > > > > > Same version of IE. Same ASP.NET server. Just a different
browser.
> > I
> > > > have
> > > > > already played around with the privacy settings with no success.
I
> am
> > > not
> > > > > suspect of the server at this point, because the w2k computer
works
> > > fine.
> > > > > > > > Any thoughts would be appreciated.
> > > > > > > > Thanks,
> > > > > Marc.
> > > > > > > > > > > >

Session variable not set

Hi All,
I built a web application using cookieless session. It merely checks
for the session variable value upon login. This method works fine on
the host pc.
However, when i try to access the application via another pc in the
network, the login page redirects to itself even though the correct
passwd and usename is entered. I did a response.write and realise that
the value of the session variable is not set. How can i solve this
prob?
Any Help is greatly appreciated.
Tks...ywzCheck out http://weblogs.asp.net/bleroy/archi.../03/207486.aspx
it might solve your problem...
Karl
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"ywz" <ywz.oct13@.gmail.com> wrote in message
news:1113293239.075593.241860@.o13g2000cwo.googlegroups.com...
> Hi All,
>
> I built a web application using cookieless session. It merely checks
> for the session variable value upon login. This method works fine on
> the host pc.
> However, when i try to access the application via another pc in the
> network, the login page redirects to itself even though the correct
> passwd and usename is entered. I did a response.write and realise that
> the value of the session variable is not set. How can i solve this
> prob?
>
> Any Help is greatly appreciated.
> Tks...ywz
>
The fact that it works on one and not the other means this is probably not
the answer, although this is a great post.
The major problem, IMO, is the fact that ywz is using an ASP methodology
(session var) in an ASP.NET world.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"Karl Seguin" wrote:

> Check out http://weblogs.asp.net/bleroy/archi.../03/207486.aspx
> it might solve your problem...
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
>
> "ywz" <ywz.oct13@.gmail.com> wrote in message
> news:1113293239.075593.241860@.o13g2000cwo.googlegroups.com...
>
>

Session variable not set

Hi All,

I built a web application using cookieless session. It merely checks
for the session variable value upon login. This method works fine on
the host pc.
However, when i try to access the application via another pc in the
network, the login page redirects to itself even though the correct
passwd and usename is entered. I did a response.write and realise that
the value of the session variable is not set. How can i solve this
prob?

Any Help is greatly appreciated.
Tks...ywzCheck out http://weblogs.asp.net/bleroy/archi.../03/207486.aspx
it might solve your problem...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)

"ywz" <ywz.oct13@.gmail.com> wrote in message
news:1113293239.075593.241860@.o13g2000cwo.googlegr oups.com...
> Hi All,
>
> I built a web application using cookieless session. It merely checks
> for the session variable value upon login. This method works fine on
> the host pc.
> However, when i try to access the application via another pc in the
> network, the login page redirects to itself even though the correct
> passwd and usename is entered. I did a response.write and realise that
> the value of the session variable is not set. How can i solve this
> prob?
>
> Any Help is greatly appreciated.
> Tks...ywz
The fact that it works on one and not the other means this is probably not
the answer, although this is a great post.

The major problem, IMO, is the fact that ywz is using an ASP methodology
(session var) in an ASP.NET world.

--

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Karl Seguin" wrote:

> Check out http://weblogs.asp.net/bleroy/archi.../03/207486.aspx
> it might solve your problem...
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
>
> "ywz" <ywz.oct13@.gmail.com> wrote in message
> news:1113293239.075593.241860@.o13g2000cwo.googlegr oups.com...
> > Hi All,
> > I built a web application using cookieless session. It merely checks
> > for the session variable value upon login. This method works fine on
> > the host pc.
> > However, when i try to access the application via another pc in the
> > network, the login page redirects to itself even though the correct
> > passwd and usename is entered. I did a response.write and realise that
> > the value of the session variable is not set. How can i solve this
> > prob?
> > Any Help is greatly appreciated.
> > Tks...ywz
>

Saturday, March 24, 2012

Session variable problem

Greetings!

We are having a problem with Session variables in our .net application
that I hope someone can assist with.

our application stores UserIDs in a session variable at login. We have
an "inbox" aspx page that store user's messages in SQL Server. The
stored procedure uses to populate inbox uses the Session("UserID") to
pull the user's messages. Somehow UserA is bringing back UserB's
messages.

This problem isn't limited to the inbox aspx page, but to any page that
uses Session variables.

Any help would be much appreciated. If you need more info, please let
me know.

Best Regards,
Gene

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Are you using a clustered environment by any chance?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.

"Gene" <mooola@.yahoo.com> wrote in message
news:OYuKV80aDHA.3360@.tk2msftngp13.phx.gbl...
> Greetings!
> We are having a problem with Session variables in our .net application
> that I hope someone can assist with.
> our application stores UserIDs in a session variable at login. We have
> an "inbox" aspx page that store user's messages in SQL Server. The
> stored procedure uses to populate inbox uses the Session("UserID") to
> pull the user's messages. Somehow UserA is bringing back UserB's
> messages.
> This problem isn't limited to the inbox aspx page, but to any page that
> uses Session variables.
> Any help would be much appreciated. If you need more info, please let
> me know.
> Best Regards,
> Gene
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
No web farms or anythign like that. We have a single box that has 4
CPUs.

Best Regards,
Gene

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Futhermore, I was talking to our Sys Admin and he said the problem could
be caused because the client may be running a proxy server. This sounds
like a viable reason, but we are using cookieless sessions so the URL is
always unique.

Best Regards,
Gene

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

Session Variable References Incorrect

I have a fairly large application with about 200 users that uses Session
variables. It would seem that occasionally these variables are being
referenced incorrectly to the extent that different users are updating
information and it is being saved to the wrong user. Is there any problem
with Session Variables that would cause this?not with session. more likley a coding bug where you store session values in
a shared (static) member, or vb module (whose members are all shared).

-- bruce (sqlwork.com)

"GHawley" <GHawley@.discussions.microsoft.com> wrote in message
news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
>I have a fairly large application with about 200 users that uses Session
> variables. It would seem that occasionally these variables are being
> referenced incorrectly to the extent that different users are updating
> information and it is being saved to the wrong user. Is there any problem
> with Session Variables that would cause this?
The application simply references the Session["variable"] where ever it wants
to use it. The variable isn't stored, just referenced.

Thanks for the speedy response though.

"bruce barker (sqlwork.com)" wrote:

> not with session. more likley a coding bug where you store session values in
> a shared (static) member, or vb module (whose members are all shared).
> -- bruce (sqlwork.com)
> "GHawley" <GHawley@.discussions.microsoft.com> wrote in message
> news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
> >I have a fairly large application with about 200 users that uses Session
> > variables. It would seem that occasionally these variables are being
> > referenced incorrectly to the extent that different users are updating
> > information and it is being saved to the wrong user. Is there any problem
> > with Session Variables that would cause this?
>
I would like to retract my previous statement and thank Bruce Barker for the
insight. I believe this is exactly the problem.

1 thousand times, thank you!!!!

"GHawley" wrote:

> The application simply references the Session["variable"] where ever it wants
> to use it. The variable isn't stored, just referenced.
> Thanks for the speedy response though.
> "bruce barker (sqlwork.com)" wrote:
> > not with session. more likley a coding bug where you store session values in
> > a shared (static) member, or vb module (whose members are all shared).
> > -- bruce (sqlwork.com)
> > "GHawley" <GHawley@.discussions.microsoft.com> wrote in message
> > news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
> > >I have a fairly large application with about 200 users that uses Session
> > > variables. It would seem that occasionally these variables are being
> > > referenced incorrectly to the extent that different users are updating
> > > information and it is being saved to the wrong user. Is there any problem
> > > with Session Variables that would cause this?

Session Variable References Incorrect

I have a fairly large application with about 200 users that uses Session
variables. It would seem that occasionally these variables are being
referenced incorrectly to the extent that different users are updating
information and it is being saved to the wrong user. Is there any problem
with Session Variables that would cause this?not with session. more likley a coding bug where you store session values in
a shared (static) member, or vb module (whose members are all shared).
-- bruce (sqlwork.com)
"GHawley" <GHawley@.discussions.microsoft.com> wrote in message
news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
>I have a fairly large application with about 200 users that uses Session
> variables. It would seem that occasionally these variables are being
> referenced incorrectly to the extent that different users are updating
> information and it is being saved to the wrong user. Is there any problem
> with Session Variables that would cause this?
The application simply references the Session["variable"] where ever it want
s
to use it. The variable isn't stored, just referenced.
Thanks for the speedy response though.
"bruce barker (sqlwork.com)" wrote:

> not with session. more likley a coding bug where you store session values
in
> a shared (static) member, or vb module (whose members are all shared).
> -- bruce (sqlwork.com)
> "GHawley" <GHawley@.discussions.microsoft.com> wrote in message
> news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
>
>
I would like to retract my previous statement and thank Bruce Barker for the
insight. I believe this is exactly the problem.
1 thousand times, thank you!!!!
"GHawley" wrote:
> The application simply references the Session["variable"] where ever it wa
nts
> to use it. The variable isn't stored, just referenced.
> Thanks for the speedy response though.
> "bruce barker (sqlwork.com)" wrote:
>

Session variable, Profile or page-by-page check?

I'm currently building an Intranet application to track projects set up by my company. It's secured using Windows authentication, with the users allocated into various NT roles. Users should only be able to edit actions raised on them by a steering group, although they may view other people's actions. They may also be in one or more of the steering groups, each of which should only be able to approve projects specifically set up in their 'area'.

I was thinking of setting up a profile for each user, but I can't really see the point as it would just be duplicating data that's already held in the database. I could also retrieve them specifically on each page where they're needed and cache them, but that seems to be just replicating what Session variables would be doing.

So, if I create a couple of Session variables, one to hold the user's ID from a database table and the other to hold a list of which steering groups they're members of, assign them at Session_Start, then check these variables on the appropriate web pages and disable/ enable editing accordingly- is this a suitable way of controlling access? Will there be any problems with the session variables being lost, do I need to check if they're null on each page where they're used and re-retrieve them from my BLL if necessary? Is there a chance of the variables being 'hijacked'- ie should I be looking for a more secure way of storing them?

Thanks for any help.

A session variable to hold the user's Id and group list is good. If you are using ASP.NET 2.0, put the code to check for the user's id in the master page. Thus you do not have to check on any page that uses that master page.

You do need to allow for authenticated user's that are not in your database table and redirect to page with a message like "As user DOMAIN\FRED.BLOGGS you do not have access to this system, please contact the support line on XXXX if you require access.

Session variables will be lost if the user's session times out. It is tempting to increase the timeout, but unless you have a rigorous policy of locking unattended Pc's, leave it on the default of 20 minutes or even decrease it.

My preference is always to run cookieless and to hold session state either in memory or in SQL State.


Great, thanks very much. Do you have any strategy of dealing with timeouts?

>Do you have any strategy of dealing with timeouts?

The strategy depends on the environment. If the Windows policies will cause the PC go to a passworded screen-saver after say 5 minutes of non-use, then you can increase the timeout time with impunity, otherwise it is primarily a simple matter of user education.

Some reduction in susceptibility to timeouts can be achieved by adopting a multi-screen approach as opposed to a wizard, as the first screen can create a new record and the other screens merely update it.

Session variables

Hi,
Basically I see two options:
1- Use application variables, with a Hashtable and the userID is the key.
2- Use a class with a static Hashtable or similar struct. it will be global
to the application therefore will not expire with the section.
Please note that both solutions assume that you are doing this for
registered users, if you allow anonymous users and treat each session as a
different user you have to do something else.
Cheers,
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:B3D56FFC-CC10-495D-9C62-450DED7D33B2@dotnet.itags.org.microsoft.com...
> I see Session variables time out after 20 minutes (or whatever number of
minutes you define).
> I want to have some variables that won't time out, but they only occupy
very small amounts of data, say 10-20 bytes per user, so I think it won't
too much of a performance impact to store it in the web server's memory.
Would having hash tables as global variables using the SessionID as key work
OK? Global variables and SessionIDs don't time out do they?"Bonj" <anonymous@.discussions.microsoft.com> wrote in message news:B3D56FFC-CC10-495D-9C62-
450DED7D33B2@.microsoft.com...
> I see Session variables time out after 20 minutes (or whatever number of m
inutes you define).
> I want to have some variables that won't time out, but they only occupy very small
amounts of data, say 10-20 bytes per user, so I
think it won't too much of a performance impact to store it in the web serve
r's memory. Would having hash tables as global variables
using the SessionID as key work OK? Global variables and SessionIDs don't ti
me out do they?
It's not the session *variables* that time out, it's the *session* that will
be removed (along with all stored values) after the user has done
nothing (=no new page request) for 20 minutes.
How long do you want to keep this data? Could you store it in
a database?
Hans Kesting
All Session variables expires after 20 (or x minutes you choose) whatever
type they have, also the corresponding SessionID of the expired Session. Use
Application variables to store common variables.
Horatiu Ripa
"Bonj" <anonymous@.discussions.microsoft.com> wrote in message
news:B3D56FFC-CC10-495D-9C62-450DED7D33B2@.microsoft.com...
> I see Session variables time out after 20 minutes (or whatever number of
minutes you define).
> I want to have some variables that won't time out, but they only occupy
very small amounts of data, say 10-20 bytes per user, so I think it won't
too much of a performance impact to store it in the web server's memory.
Would having hash tables as global variables using the SessionID as key work
OK? Global variables and SessionIDs don't time out do they?
You could also look at storing this data in an encrypted cookie. Then you
can set the timeout to whatever you wish with no server overhead.
-mike
MVP
"Bonj" <anonymous@.discussions.microsoft.com> wrote in message
news:B3D56FFC-CC10-495D-9C62-450DED7D33B2@.microsoft.com...
>I see Session variables time out after 20 minutes (or whatever number of
>minutes you define).
> I want to have some variables that won't time out, but they only occupy
> very small amounts of data, say 10-20 bytes per user, so I think it won't
> too much of a performance impact to store it in the web server's memory.
> Would having hash tables as global variables using the SessionID as key
> work OK? Global variables and SessionIDs don't time out do they?