473,425 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

Persistent Forms Authentication - and Session Variables

Max
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
Nov 19 '05 #1
5 1504
"Max" <ze**@maxdot.com.com> wrote in message
news:uk**************@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
Nov 19 '05 #2
Max
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:ew**************@TK2MSFTNGP15.phx.gbl...
"Max" <ze**@maxdot.com.com> wrote in message
news:uk**************@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

Nov 19 '05 #3
"Max" <ze**@maxdot.com.com> wrote in message
news:ed**************@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:ew**************@TK2MSFTNGP15.phx.gbl...
"Max" <ze**@maxdot.com.com> wrote in message
news:uk**************@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


Nov 19 '05 #4
Max
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:uF**************@TK2MSFTNGP10.phx.gbl...
"Max" <ze**@maxdot.com.com> wrote in message
news:ed**************@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:ew**************@TK2MSFTNGP15.phx.gbl...
"Max" <ze**@maxdot.com.com> wrote in message
news:uk**************@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



Nov 19 '05 #5
"Max" <ze**@maxdot.com.com> wrote in message
news:er**************@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:uF**************@TK2MSFTNGP10.phx.gbl...
"Max" <ze**@maxdot.com.com> wrote in message
news:ed**************@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:ew**************@TK2MSFTNGP15.phx.gbl...
"Max" <ze**@maxdot.com.com> wrote in message
news:uk**************@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



Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul M | last post by:
Hi folks, Am new to asp.net and I'm trying to find out how to keep persistent information. The main thing I need to do is carry round an encrypted connection string for my database, but there...
0
by: Kepler | last post by:
I'm testing very basic FormsAuthentication and having trouble with non-persistent cookies. Once authenticated with a non-persistent cookie, if I leave the browser alone for 30 minutes,...
8
by: bashful.belle | last post by:
I'm using Forms authentication and a non persistent cookie in my asp.net application. How do i get the cookie to time out after a period of inactivity, say 10 minutes, and force the user to login...
3
by: sanchita | last post by:
Hello everyone, I didn't get any response in "Security" forum hence posting here again. I am having problem with persistent cookies. Even after setting "CreatePersistentCookie" to true in...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.