Showing posts with label session. Show all posts
Showing posts with label session. Show all posts

Thursday, March 29, 2012

Performance Q..

My development environments are ASP.Net and VB.Net and .NetFramework1.1.

I remember reading "using less number of session variables is good for
application performance".

Now instead of using 20 session variables, I can use one session variable
which carries the data for all the 20 variables that I want to keep track.

Is it a good idea? Any documentation on how exactly the sessions variables
are processed and stored in IIS5?

Thanks,

Lalit SinghPerformance generally falls into 2 categories: Processor and Memory.
Anything which saves Processor usage or Memory usage improves performance.
If you can remember that, you can stop relying on opinions you read to
determine what you should do.

Session is memory. Anything which reduces Session size will improve
performance. Combining Session variables into a single object isn't likely
to improve performance, as you aren't changing the size of anything, just
how it is stored. If I put 5 apples in a box, I still have 5 apples. I also
have the box now.

Programming instructions are Processor. If, by putting all of these objects
into a single object enables you to write leaner code, you will improve
performance. For example, using the apples again, taking the apples out of
Session one at a time, I need to write 5 sets of instructions, or a loop
that executes 5 times. If I take the box out, I use only 1 instruction. Of
course, at some point you're going to need to take the apples out of the
box. So, that kind of cancels out the savings there.

But let me get back to my original point: Don't rely on opinions. If you're
really concerned about performance, keep your eye on Memory usage and
Processor usage. Don't concentrate on Session. Concentrate on your whole
app. Look for opportunites to write leaner code, and maximize memory usage.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> I remember reading "using less number of session variables is good for
> application performance".
> Now instead of using 20 session variables, I can use one session variable
> which carries the data for all the 20 variables that I want to keep track.
> Is it a good idea? Any documentation on how exactly the sessions variables
> are processed and stored in IIS5?
> Thanks,
> Lalit Singh
Thanks,
I was waiting to post during this hour of the day so that you will respond.
Thanks,
Lalit

"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:#X6bD6g3EHA.3708@.TK2MSFTNGP14.phx.gbl...
> Performance generally falls into 2 categories: Processor and Memory.
> Anything which saves Processor usage or Memory usage improves performance.
> If you can remember that, you can stop relying on opinions you read to
> determine what you should do.
> Session is memory. Anything which reduces Session size will improve
> performance. Combining Session variables into a single object isn't likely
> to improve performance, as you aren't changing the size of anything, just
> how it is stored. If I put 5 apples in a box, I still have 5 apples. I
also
> have the box now.
> Programming instructions are Processor. If, by putting all of these
objects
> into a single object enables you to write leaner code, you will improve
> performance. For example, using the apples again, taking the apples out of
> Session one at a time, I need to write 5 sets of instructions, or a loop
> that executes 5 times. If I take the box out, I use only 1 instruction. Of
> course, at some point you're going to need to take the apples out of the
> box. So, that kind of cancels out the savings there.
> But let me get back to my original point: Don't rely on opinions. If
you're
> really concerned about performance, keep your eye on Memory usage and
> Processor usage. Don't concentrate on Session. Concentrate on your whole
> app. Look for opportunites to write leaner code, and maximize memory
usage.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
> news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> > My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> > I remember reading "using less number of session variables is good for
> > application performance".
> > Now instead of using 20 session variables, I can use one session
variable
> > which carries the data for all the 20 variables that I want to keep
track.
> > Is it a good idea? Any documentation on how exactly the sessions
variables
> > are processed and stored in IIS5?
> > Thanks,
> > Lalit Singh

Performance Q..

My development environments are ASP.Net and VB.Net and .NetFramework1.1.
I remember reading "using less number of session variables is good for
application performance".
Now instead of using 20 session variables, I can use one session variable
which carries the data for all the 20 variables that I want to keep track.
Is it a good idea? Any documentation on how exactly the sessions variables
are processed and stored in IIS5?
Thanks,
Lalit SinghPerformance generally falls into 2 categories: Processor and Memory.
Anything which saves Processor usage or Memory usage improves performance.
If you can remember that, you can stop relying on opinions you read to
determine what you should do.
Session is memory. Anything which reduces Session size will improve
performance. Combining Session variables into a single object isn't likely
to improve performance, as you aren't changing the size of anything, just
how it is stored. If I put 5 apples in a box, I still have 5 apples. I also
have the box now.
Programming instructions are Processor. If, by putting all of these objects
into a single object enables you to write leaner code, you will improve
performance. For example, using the apples again, taking the apples out of
Session one at a time, I need to write 5 sets of instructions, or a loop
that executes 5 times. If I take the box out, I use only 1 instruction. Of
course, at some point you're going to need to take the apples out of the
box. So, that kind of cancels out the savings there.
But let me get back to my original point: Don't rely on opinions. If you're
really concerned about performance, keep your eye on Memory usage and
Processor usage. Don't concentrate on Session. Concentrate on your whole
app. Look for opportunites to write leaner code, and maximize memory usage.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> I remember reading "using less number of session variables is good for
> application performance".
> Now instead of using 20 session variables, I can use one session variable
> which carries the data for all the 20 variables that I want to keep track.
> Is it a good idea? Any documentation on how exactly the sessions variables
> are processed and stored in IIS5?
> Thanks,
> Lalit Singh
>
Thanks,
I was waiting to post during this hour of the day so that you will respond.
Thanks,
Lalit
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:#X6bD6g3EHA.3708@.TK2MSFTNGP14.phx.gbl...
> Performance generally falls into 2 categories: Processor and Memory.
> Anything which saves Processor usage or Memory usage improves performance.
> If you can remember that, you can stop relying on opinions you read to
> determine what you should do.
> Session is memory. Anything which reduces Session size will improve
> performance. Combining Session variables into a single object isn't likely
> to improve performance, as you aren't changing the size of anything, just
> how it is stored. If I put 5 apples in a box, I still have 5 apples. I
also
> have the box now.
> Programming instructions are Processor. If, by putting all of these
objects
> into a single object enables you to write leaner code, you will improve
> performance. For example, using the apples again, taking the apples out of
> Session one at a time, I need to write 5 sets of instructions, or a loop
> that executes 5 times. If I take the box out, I use only 1 instruction. Of
> course, at some point you're going to need to take the apples out of the
> box. So, that kind of cancels out the savings there.
> But let me get back to my original point: Don't rely on opinions. If
you're
> really concerned about performance, keep your eye on Memory usage and
> Processor usage. Don't concentrate on Session. Concentrate on your whole
> app. Look for opportunites to write leaner code, and maximize memory
usage.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
> news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
variable
track.
variables
>

Monday, March 26, 2012

performance when refer to session object or variable

hi ive got some session objects which im using in some long switch statements.

performance wise is it better to assign the session objects to string variables first then use the variables within my code.

or is it just as good to use the session objects themselves each time within my code using the Tostring() method?

which is better please?If you could enumerate the objects to an intrinsic type like byte or int or something you will see a performance increase after approxamately three calls to the session variables. This is approxamate you can bench it yourself to get more accurate but your initial suspision is correct. I don;t think using a string would perform as well.

Wednesday, March 21, 2012

Perserving characters in Session object

Hi,

I am having a problem storing Irish text in a session object - Irish text
has some symbols ( for example) that are being lost when I retrieve the
text from the session.

Any ideas how I can deal with this - the characters are being displayed
correctly on the page itself if they come from the database or any other
source rather than the session object.

JoeAcutally after a bit of further investigation I discovered that by default
asp.net uses UTF-8 (unicode) for everything which would accommodate these
characters. What was happening in my case was that I was using the thycotic
remote scripting component to do some server updates and to send such
characters to the server requires that you urlencode them first as that
component seems to rely on a hidden frame in the page to call the remote
script.

"Joe Molloy" <molloy_joe@.hotmail.com> wrote in message
news:OcCcchFxFHA.2960@.tk2msftngp13.phx.gbl...
> Hi,
> I am having a problem storing Irish text in a session object - Irish text
> has some symbols ( for example) that are being lost when I retrieve the
> text from the session.
> Any ideas how I can deal with this - the characters are being displayed
> correctly on the page itself if they come from the database or any other
> source rather than the session object.
>
> Joe

Per-session memory consumption in ASP.NET worker process

Hello,

Is there any way to find out how much memory each web session is
consuming within the ASP.NET worker process (aspnet_wp.exe)? Further,
is it possible to find how much memory is consumed by session
variables alone?

- Jim CampbellJim Campbell wrote:

> Hello,
> Is there any way to find out how much memory each web session is
> consuming within the ASP.NET worker process (aspnet_wp.exe)? Further,
> is it possible to find how much memory is consumed by session
> variables alone?
> - Jim Campbell
hi Jim,

one way to accomplish this can be
to do some production debugging and get the memory dump of aspnet_wp to
look at the number of session variables in the worker process..
following link can get you started

http://msdn.microsoft.com/library/d...tml/DBGch01.asp

there might certainly be simpler ways to do this, but this is one way to
accomplish this ..

Perserving characters in Session object

Hi,
I am having a problem storing Irish text in a session object - Irish text
has some symbols ( for example) that are being lost when I retrieve the
text from the session.
Any ideas how I can deal with this - the characters are being displayed
correctly on the page itself if they come from the database or any other
source rather than the session object.
JoeAcutally after a bit of further investigation I discovered that by default
asp.net uses UTF-8 (unicode) for everything which would accommodate these
characters. What was happening in my case was that I was using the thycotic
remote scripting component to do some server updates and to send such
characters to the server requires that you urlencode them first as that
component seems to rely on a hidden frame in the page to call the remote
script.
"Joe Molloy" <molloy_joe@.hotmail.com> wrote in message
news:OcCcchFxFHA.2960@.tk2msftngp13.phx.gbl...
> Hi,
> I am having a problem storing Irish text in a session object - Irish text
> has some symbols ( for example) that are being lost when I retrieve the
> text from the session.
> Any ideas how I can deal with this - the characters are being displayed
> correctly on the page itself if they come from the database or any other
> source rather than the session object.
>
> Joe
>

persist a class over a session - concept

hello,
i have a class, for example :"CustomerClass" , with a set of public
properies like CustNr,CustName,CustEmail ...
The class is initialised when the session is started.
What is the best way to persist the property values?
Must each property stored in a separate session, and by each access read the
valueof the session - or exist a better way...
thankshttp://spaces.msn.com/sholliday/ 10/24/2005
Check my Blog.
This is a wrapper... to store objects in a session, ... not just properties
of objects.
..
"Xavier" <Xavier@.discussions.microsoft.com> wrote in message
news:DA11396B-EC6B-44BD-BD1C-2ACE2EE491B0@.microsoft.com...
> hello,
> i have a class, for example :"CustomerClass" , with a set of public
> properies like CustNr,CustName,CustEmail ...
> The class is initialised when the session is started.
> What is the best way to persist the property values?
> Must each property stored in a separate session, and by each access read
the
> valueof the session - or exist a better way...
> thanks

persist a class over a session - concept

hello,

i have a class, for example :"CustomerClass" , with a set of public
properies like CustNr,CustName,CustEmail ...
The class is initialised when the session is started.

What is the best way to persist the property values?
Must each property stored in a separate session, and by each access read the
valueof the session - or exist a better way...

thankshttp://spaces.msn.com/sholliday/ 10/24/2005

Check my Blog.

This is a wrapper... to store objects in a session, ... not just properties
of objects.

...

"Xavier" <Xavier@.discussions.microsoft.com> wrote in message
news:DA11396B-EC6B-44BD-BD1C-2ACE2EE491B0@.microsoft.com...
> hello,
> i have a class, for example :"CustomerClass" , with a set of public
> properies like CustNr,CustName,CustEmail ...
> The class is initialised when the session is started.
> What is the best way to persist the property values?
> Must each property stored in a separate session, and by each access read
the
> valueof the session - or exist a better way...
> thanks

Friday, March 16, 2012

Persistent Forms Authentication - and Session Variables

Hi All!
I'm doing an ASP.NET project which uses Persistent Forms Authentication
(i.e. once user logged in, they don't have to log in again). However Session
variables are erased after Session has timed out. So I need to re-populate
user specific session variables (such as user email, DOB, Full Name...etc)
when Session has ended.
But strangely, when I tried to do something like...
Dim strArrayUserInfo(10) as String
strArrayUserInfo(0) = drDataReader("FName").ToString
strArrayUserInfo(1) = drDataReader("LName").ToString
strArrayUserInfo(2) = drDataReader("Email").ToString
Session("UserInfoArray") = strArrayUserInfo
I get System.StackOverflowException. If I comment out that line, application
runs correctly but fail at the point where Session("UserInfoArray") is
accessed (i.e. Null Exception). So I de-comment the above code and I was
thrown System.StackOverflowException again.
What could be the problem? I was merely assigning a variable to Session
variable collection. Why ASP.NET throws System.StackOverflowException'
Thank you all in advance!!!!
Max"Max" <zero@.maxdot.com.com> wrote in message
news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Hi All!
> I'm doing an ASP.NET project which uses Persistent Forms Authentication
> (i.e. once user logged in, they don't have to log in again). However
> Session variables are erased after Session has timed out. So I need to
> re-populate user specific session variables (such as user email, DOB, Full
> Name...etc) when Session has ended.
> But strangely, when I tried to do something like...
> Dim strArrayUserInfo(10) as String
> strArrayUserInfo(0) = drDataReader("FName").ToString
> strArrayUserInfo(1) = drDataReader("LName").ToString
> strArrayUserInfo(2) = drDataReader("Email").ToString
> Session("UserInfoArray") = strArrayUserInfo
> I get System.StackOverflowException. If I comment out that line,
> application runs correctly but fail at the point where
> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
> de-comment the above code and I was thrown System.StackOverflowException
> again.
> What could be the problem? I was merely assigning a variable to Session
> variable collection. Why ASP.NET throws System.StackOverflowException'
I bet you have something else called "Session". Change the line to refer to
HttpContext.Current.Session and see if that's any better.
John Saunders
Hi John,
Thanks for the quick response! Unfortunately, I get the same error :(
Any ideas?
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> I bet you have something else called "Session". Change the line to refer
> to HttpContext.Current.Session and see if that's any better.
> John Saunders
>
"Max" <zero@.maxdot.com.com> wrote in message
news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Hi John,
> Thanks for the quick response! Unfortunately, I get the same error :(
Several ideas, none brilliant.
1) Simplify, simplify, simplify
1a) Instead of filling from the datareader, try setting the array elements
to constants. It's simpler.
1b) Try using Session("a"). It's simpler.
2) Are you setting all 10 elements of the array?
3) Turn Options Strict On.
John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>
Hi John,
I tried reducing the Array length to 3 and still it didn't work. This is a
mystery and a nightmare.
Max
"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Several ideas, none brilliant.
> 1) Simplify, simplify, simplify
> 1a) Instead of filling from the datareader, try setting the array elements
> to constants. It's simpler.
> 1b) Try using Session("a"). It's simpler.
> 2) Are you setting all 10 elements of the array?
> 3) Turn Options Strict On.
> John Saunders
>
>
>
"Max" <zero@.maxdot.com.com> wrote in message
news:erNBq2U8EHA.2124@.TK2MSFTNGP14.phx.gbl...
> Hi John,
> I tried reducing the Array length to 3 and still it didn't work. This is a
> mystery and a nightmare.
Did you try using an array filled with constants? Did you try using
Session("a")? Have you turned Options Strict On?
John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
>

Persistent Forms Authentication - and Session Variables

Hi All!

I'm doing an ASP.NET project which uses Persistent Forms Authentication
(i.e. once user logged in, they don't have to log in again). However Session
variables are erased after Session has timed out. So I need to re-populate
user specific session variables (such as user email, DOB, Full Name...etc)
when Session has ended.

But strangely, when I tried to do something like...

Dim strArrayUserInfo(10) as String

strArrayUserInfo(0) = drDataReader("FName").ToString
strArrayUserInfo(1) = drDataReader("LName").ToString
strArrayUserInfo(2) = drDataReader("Email").ToString

Session("UserInfoArray") = strArrayUserInfo

I get System.StackOverflowException. If I comment out that line, application
runs correctly but fail at the point where Session("UserInfoArray") is
accessed (i.e. Null Exception). So I de-comment the above code and I was
thrown System.StackOverflowException again.

What could be the problem? I was merely assigning a variable to Session
variable collection. Why ASP.NET throws System.StackOverflowException??

Thank you all in advance!!!!

Max"Max" <zero@.maxdot.com.com> wrote in message
news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
> Hi All!
> I'm doing an ASP.NET project which uses Persistent Forms Authentication
> (i.e. once user logged in, they don't have to log in again). However
> Session variables are erased after Session has timed out. So I need to
> re-populate user specific session variables (such as user email, DOB, Full
> Name...etc) when Session has ended.
> But strangely, when I tried to do something like...
> Dim strArrayUserInfo(10) as String
> strArrayUserInfo(0) = drDataReader("FName").ToString
> strArrayUserInfo(1) = drDataReader("LName").ToString
> strArrayUserInfo(2) = drDataReader("Email").ToString
> Session("UserInfoArray") = strArrayUserInfo
> I get System.StackOverflowException. If I comment out that line,
> application runs correctly but fail at the point where
> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
> de-comment the above code and I was thrown System.StackOverflowException
> again.
> What could be the problem? I was merely assigning a variable to Session
> variable collection. Why ASP.NET throws System.StackOverflowException??

I bet you have something else called "Session". Change the line to refer to
HttpContext.Current.Session and see if that's any better.

John Saunders
Hi John,

Thanks for the quick response! Unfortunately, I get the same error :(

Any ideas?

Max

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>> Hi All!
>>
>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>> (i.e. once user logged in, they don't have to log in again). However
>> Session variables are erased after Session has timed out. So I need to
>> re-populate user specific session variables (such as user email, DOB,
>> Full Name...etc) when Session has ended.
>>
>> But strangely, when I tried to do something like...
>>
>> Dim strArrayUserInfo(10) as String
>>
>> strArrayUserInfo(0) = drDataReader("FName").ToString
>> strArrayUserInfo(1) = drDataReader("LName").ToString
>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>
>> Session("UserInfoArray") = strArrayUserInfo
>>
>> I get System.StackOverflowException. If I comment out that line,
>> application runs correctly but fail at the point where
>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>> de-comment the above code and I was thrown System.StackOverflowException
>> again.
>>
>> What could be the problem? I was merely assigning a variable to Session
>> variable collection. Why ASP.NET throws System.StackOverflowException??
> I bet you have something else called "Session". Change the line to refer
> to HttpContext.Current.Session and see if that's any better.
> John Saunders
"Max" <zero@.maxdot.com.com> wrote in message
news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
> Hi John,
> Thanks for the quick response! Unfortunately, I get the same error :(

Several ideas, none brilliant.

1) Simplify, simplify, simplify
1a) Instead of filling from the datareader, try setting the array elements
to constants. It's simpler.
1b) Try using Session("a"). It's simpler.
2) Are you setting all 10 elements of the array?
3) Turn Options Strict On.

John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>> "Max" <zero@.maxdot.com.com> wrote in message
>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>> Hi All!
>>>
>>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>>> (i.e. once user logged in, they don't have to log in again). However
>>> Session variables are erased after Session has timed out. So I need to
>>> re-populate user specific session variables (such as user email, DOB,
>>> Full Name...etc) when Session has ended.
>>>
>>> But strangely, when I tried to do something like...
>>>
>>> Dim strArrayUserInfo(10) as String
>>>
>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>
>>> Session("UserInfoArray") = strArrayUserInfo
>>>
>>> I get System.StackOverflowException. If I comment out that line,
>>> application runs correctly but fail at the point where
>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>> de-comment the above code and I was thrown System.StackOverflowException
>>> again.
>>>
>>> What could be the problem? I was merely assigning a variable to
>>> Session variable collection. Why ASP.NET throws
>>> System.StackOverflowException??
>>
>> I bet you have something else called "Session". Change the line to refer
>> to HttpContext.Current.Session and see if that's any better.
>>
>> John Saunders
>>
>>
Hi John,

I tried reducing the Array length to 3 and still it didn't work. This is a
mystery and a nightmare.

Max

"John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
> "Max" <zero@.maxdot.com.com> wrote in message
> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
>> Hi John,
>>
>> Thanks for the quick response! Unfortunately, I get the same error :(
> Several ideas, none brilliant.
> 1) Simplify, simplify, simplify
> 1a) Instead of filling from the datareader, try setting the array elements
> to constants. It's simpler.
> 1b) Try using Session("a"). It's simpler.
> 2) Are you setting all 10 elements of the array?
> 3) Turn Options Strict On.
> John Saunders
>
>> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
>> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>> "Max" <zero@.maxdot.com.com> wrote in message
>>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>> Hi All!
>>>>
>>>> I'm doing an ASP.NET project which uses Persistent Forms Authentication
>>>> (i.e. once user logged in, they don't have to log in again). However
>>>> Session variables are erased after Session has timed out. So I need to
>>>> re-populate user specific session variables (such as user email, DOB,
>>>> Full Name...etc) when Session has ended.
>>>>
>>>> But strangely, when I tried to do something like...
>>>>
>>>> Dim strArrayUserInfo(10) as String
>>>>
>>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>>
>>>> Session("UserInfoArray") = strArrayUserInfo
>>>>
>>>> I get System.StackOverflowException. If I comment out that line,
>>>> application runs correctly but fail at the point where
>>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>>> de-comment the above code and I was thrown
>>>> System.StackOverflowException again.
>>>>
>>>> What could be the problem? I was merely assigning a variable to
>>>> Session variable collection. Why ASP.NET throws
>>>> System.StackOverflowException??
>>>
>>> I bet you have something else called "Session". Change the line to refer
>>> to HttpContext.Current.Session and see if that's any better.
>>>
>>> John Saunders
>>>
>>>
>>
>>
"Max" <zero@.maxdot.com.com> wrote in message
news:erNBq2U8EHA.2124@.TK2MSFTNGP14.phx.gbl...
> Hi John,
> I tried reducing the Array length to 3 and still it didn't work. This is a
> mystery and a nightmare.

Did you try using an array filled with constants? Did you try using
Session("a")? Have you turned Options Strict On?

John Saunders

> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
> news:uFWbK777EHA.2568@.TK2MSFTNGP10.phx.gbl...
>> "Max" <zero@.maxdot.com.com> wrote in message
>> news:edEOMA67EHA.2552@.TK2MSFTNGP09.phx.gbl...
>>> Hi John,
>>>
>>> Thanks for the quick response! Unfortunately, I get the same error :(
>>
>> Several ideas, none brilliant.
>>
>> 1) Simplify, simplify, simplify
>> 1a) Instead of filling from the datareader, try setting the array
>> elements to constants. It's simpler.
>> 1b) Try using Session("a"). It's simpler.
>> 2) Are you setting all 10 elements of the array?
>> 3) Turn Options Strict On.
>>
>> John Saunders
>>
>>
>>
>>> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
>>> news:ew5r0757EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>> "Max" <zero@.maxdot.com.com> wrote in message
>>>> news:ukaISv57EHA.2016@.TK2MSFTNGP15.phx.gbl...
>>>>> Hi All!
>>>>>
>>>>> I'm doing an ASP.NET project which uses Persistent Forms
>>>>> Authentication (i.e. once user logged in, they don't have to log in
>>>>> again). However Session variables are erased after Session has timed
>>>>> out. So I need to re-populate user specific session variables (such as
>>>>> user email, DOB, Full Name...etc) when Session has ended.
>>>>>
>>>>> But strangely, when I tried to do something like...
>>>>>
>>>>> Dim strArrayUserInfo(10) as String
>>>>>
>>>>> strArrayUserInfo(0) = drDataReader("FName").ToString
>>>>> strArrayUserInfo(1) = drDataReader("LName").ToString
>>>>> strArrayUserInfo(2) = drDataReader("Email").ToString
>>>>>
>>>>> Session("UserInfoArray") = strArrayUserInfo
>>>>>
>>>>> I get System.StackOverflowException. If I comment out that line,
>>>>> application runs correctly but fail at the point where
>>>>> Session("UserInfoArray") is accessed (i.e. Null Exception). So I
>>>>> de-comment the above code and I was thrown
>>>>> System.StackOverflowException again.
>>>>>
>>>>> What could be the problem? I was merely assigning a variable to
>>>>> Session variable collection. Why ASP.NET throws
>>>>> System.StackOverflowException??
>>>>
>>>> I bet you have something else called "Session". Change the line to
>>>> refer to HttpContext.Current.Session and see if that's any better.
>>>>
>>>> John Saunders
>>>>
>>>>
>>>
>>>
>>
>>