473,663 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 strArrayUserInf o(10) as String

strArrayUserInf o(0) = drDataReader("F Name").ToString
strArrayUserInf o(1) = drDataReader("L Name").ToString
strArrayUserInf o(2) = drDataReader("E mail").ToString

Session("UserIn foArray") = strArrayUserInf o

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

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

Thank you all in advance!!!!

Max
Nov 19 '05 #1
5 1515
"Max" <ze**@maxdot.co m.com> wrote in message
news:uk******** ******@TK2MSFTN GP15.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 strArrayUserInf o(10) as String

strArrayUserInf o(0) = drDataReader("F Name").ToString
strArrayUserInf o(1) = drDataReader("L Name").ToString
strArrayUserInf o(2) = drDataReader("E mail").ToString

Session("UserIn foArray") = strArrayUserInf o

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

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


I bet you have something else called "Session". Change the line to refer to
HttpContext.Cur rent.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" <johnwsaundersi ii at hotmail.com> wrote in message
news:ew******** ******@TK2MSFTN GP15.phx.gbl...
"Max" <ze**@maxdot.co m.com> wrote in message
news:uk******** ******@TK2MSFTN GP15.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 strArrayUserInf o(10) as String

strArrayUserInf o(0) = drDataReader("F Name").ToString
strArrayUserInf o(1) = drDataReader("L Name").ToString
strArrayUserInf o(2) = drDataReader("E mail").ToString

Session("UserIn foArray") = strArrayUserInf o

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

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


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

John Saunders

Nov 19 '05 #3
"Max" <ze**@maxdot.co m.com> wrote in message
news:ed******** ******@TK2MSFTN GP09.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" <johnwsaundersi ii at hotmail.com> wrote in message
news:ew******** ******@TK2MSFTN GP15.phx.gbl...
"Max" <ze**@maxdot.co m.com> wrote in message
news:uk******** ******@TK2MSFTN GP15.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 strArrayUserInf o(10) as String

strArrayUserInf o(0) = drDataReader("F Name").ToString
strArrayUserInf o(1) = drDataReader("L Name").ToString
strArrayUserInf o(2) = drDataReader("E mail").ToString

Session("UserIn foArray") = strArrayUserInf o

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

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


I bet you have something else called "Session". Change the line to refer
to HttpContext.Cur rent.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" <johnwsaundersi ii at hotmail.com> wrote in message
news:uF******** ******@TK2MSFTN GP10.phx.gbl...
"Max" <ze**@maxdot.co m.com> wrote in message
news:ed******** ******@TK2MSFTN GP09.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" <johnwsaundersi ii at hotmail.com> wrote in message
news:ew******** ******@TK2MSFTN GP15.phx.gbl...
"Max" <ze**@maxdot.co m.com> wrote in message
news:uk******** ******@TK2MSFTN GP15.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 strArrayUserInf o(10) as String

strArrayUserInf o(0) = drDataReader("F Name").ToString
strArrayUserInf o(1) = drDataReader("L Name").ToString
strArrayUserInf o(2) = drDataReader("E mail").ToString

Session("UserIn foArray") = strArrayUserInf o

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

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

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

John Saunders



Nov 19 '05 #5
"Max" <ze**@maxdot.co m.com> wrote in message
news:er******** ******@TK2MSFTN GP14.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" <johnwsaundersi ii at hotmail.com> wrote in message
news:uF******** ******@TK2MSFTN GP10.phx.gbl...
"Max" <ze**@maxdot.co m.com> wrote in message
news:ed******** ******@TK2MSFTN GP09.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" <johnwsaundersi ii at hotmail.com> wrote in message
news:ew******** ******@TK2MSFTN GP15.phx.gbl...
"Max" <ze**@maxdot.co m.com> wrote in message
news:uk******** ******@TK2MSFTN GP15.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 strArrayUserInf o(10) as String
>
> strArrayUserInf o(0) = drDataReader("F Name").ToString
> strArrayUserInf o(1) = drDataReader("L Name").ToString
> strArrayUserInf o(2) = drDataReader("E mail").ToString
>
> Session("UserIn foArray") = strArrayUserInf o
>
> I get System.StackOve rflowException. If I comment out that line,
> application runs correctly but fail at the point where
> Session("UserIn foArray") is accessed (i.e. Null Exception). So I
> de-comment the above code and I was thrown
> System.StackOve rflowException again.
>
> What could be the problem??? I was merely assigning a variable to
> Session variable collection. Why ASP.NET throws
> System.StackOve rflowException? ???

I bet you have something else called "Session". Change the line to
refer to HttpContext.Cur rent.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
1214
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 are likelly to be other 'system' scoped data that I'll need (database roles come to mind). I've looked at the web.config file, but that only allows a static connection
0
1876
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, Request.IsAuthenticated returns false on my next request. WHY? At first I thought it had to do with session timeout, but session timeout is set to 20 minutes, and I'm still authenticated after 20 minutes. Thirty minutes is the magic number. I'm at a loss...
8
3181
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 again? If I close the browser, the next time I use the application, it makes me log in - and That's fine. However if I keep the browser session open, it keeps my login valid for as long as the browser is open - I want it to time out. Specifying...
3
4289
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 "FormsAuthentication.SetAuthCookie" I'm being logged out after the specifed timeout provided in "forms" element of web.config. I read somewhere that lifetime of persistent cookies depend on the timeout
0
8436
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8548
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7371
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.