473,378 Members | 1,699 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,378 software developers and data experts.

Session Problem?

Hi
I posted this message few days ago but nobody answer to it.
Still have the same problem and I am hoping this time somebody will be able
to help me with it.

I have a problem with my web application. I believe the problem is
somehow related with HttpSession.
I use form authentication in my project. Once I authenticate the user and
redirect to default page
I create an User object and assign this object to session["MyUserObject"].
Then in other forms I access this object and use it to load data from
database. Some times I keep
data in the object as a property of object. For example let say my object is
student. I read student courses
and keep them as student.courses property of my user object.
It works fine but when I deploy the project to web server after some time
(may be 30 min, some timeout probably ) I start throwing following error:

Configuration Error ....

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.

Source Error:
Line 44: by Microsoft that offers a single logon and core profile
services for member sites.
Line 45: -->
Line 46: <authentication mode="Forms"> //THIS LINE IS MARKED WITH RED
COLOR
Line 47: <forms loginUrl="Secure/Login.aspx"
Line 48: name = "ASPXAUTHPCRWS"
I noticed that I get the same error if I try to assign null value to
session["MyUserObject"] in Global.aspx Session_end event handler.
Then I removed the session["MyUserObject"] = myobj from the code and the
errors sopped.
Of course my application stopped working as well since I need this object
later in my program.

I thought that the reason is that I assign session["MyUserObject"] =
myobj before user have been authenticated by
FormsAuthentication.RedirectFromLoginPage(srlzobj, false);

but the change I made to fix this does not seems to work either.

Thanks for your reply. I am getting really desperate here.
Angel


Nov 18 '05 #1
3 1169
This might be a wild goose chase, but what does your directory structure
look like? Where are the applications defined in IIS? (what directories,
nested?)

But this should fail instantly. Are you saying you can log in, browse
around, then it blows up after 30 minutes or so? Of active browsing or the
first Session Timeout?

bill
"Angel" <an*****@hotmail.com> wrote in message
news:Ok**************@TK2MSFTNGP09.phx.gbl...
Hi
I posted this message few days ago but nobody answer to it.
Still have the same problem and I am hoping this time somebody will be able to help me with it.

I have a problem with my web application. I believe the problem is
somehow related with HttpSession.
I use form authentication in my project. Once I authenticate the user and
redirect to default page
I create an User object and assign this object to session["MyUserObject"].
Then in other forms I access this object and use it to load data from
database. Some times I keep
data in the object as a property of object. For example let say my object is student. I read student courses
and keep them as student.courses property of my user object.
It works fine but when I deploy the project to web server after some time
(may be 30 min, some timeout probably ) I start throwing following error:
Configuration Error ....

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:
Line 44: by Microsoft that offers a single logon and core profile services for member sites.
Line 45: -->
Line 46: <authentication mode="Forms"> //THIS LINE IS MARKED WITH RED COLOR
Line 47: <forms loginUrl="Secure/Login.aspx"
Line 48: name = "ASPXAUTHPCRWS"
I noticed that I get the same error if I try to assign null value to
session["MyUserObject"] in Global.aspx Session_end event handler.
Then I removed the session["MyUserObject"] = myobj from the code and the
errors sopped.
Of course my application stopped working as well since I need this object
later in my program.

I thought that the reason is that I assign session["MyUserObject"] =
myobj before user have been authenticated by
FormsAuthentication.RedirectFromLoginPage(srlzobj, false);

but the change I made to fix this does not seems to work either.

Thanks for your reply. I am getting really desperate here.
Angel


Nov 18 '05 #2
This is what is happening.
I install application login, log out, create multiple sessions, browse OK.
Some time later (30min, one hour , next day . ) I try to login again. It
authenticates me and I believe on the line I say
Session["MyObject"] = MyObject it crashes.
Nov 18 '05 #3
I believe I misread what you typed earlier, or did read it clear enough. I
do not believe you have access to the Session variable in the Session_End
event. It was years ago, but I believe I ran into problems with it.

I am sorry that I will not be able to help you more without seeing more
code. For debugging purposes, attach on to the Application_Error method in
global.cs. Pull out the Server.GetLastError() exception and send that error
to yourself with email. The error message you posted, really has nothing to
do with an ArgumentNullException error. But I could be mistaken.

bill
"Angel" <an*****@hotmail.com> wrote in message
news:uc**************@TK2MSFTNGP11.phx.gbl...
This is what is happening.
I install application login, log out, create multiple sessions, browse OK.
Some time later (30min, one hour , next day . ) I try to login again. It
authenticates me and I believe on the line I say
Session["MyObject"] = MyObject it crashes.

Nov 18 '05 #4

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

Similar topics

7
by: Billy Jacobs | last post by:
I am having a problem with my session variable being set to Null for no apparent reason. I am declaring it like the following when the user logs in. dim objUserInfo as new clsUserInfo 'Set...
1
by: Scott Wickham | last post by:
I'm having a problem saving session information on one form and retrieving it on a subsequent form...for only one out of a number of users. Actually, I'm not absolutely certain it's a session...
6
by: Lina Manjarres | last post by:
Hello, I have a session variable in a login page. Then I go to a form page where I uses the ProfileID and the UserID. Then I go to a result page where I would like to use the UserID as a filter,...
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
5
by: Mark Rodrigues | last post by:
Hi Everyone, I have been fighting a problem for a while and I wonder if someone out there can help. This problem has been presented in a number of news postings previously but I am yet to see a...
9
by: William LaMartin | last post by:
I have a problem, mentioned here before, of Session and Application variables disappearing at one site but not at others or on my development computer. The problem is illustrated by an example...
1
by: Werner | last post by:
Hi Patrick! Can you give an example of how to use a frameset inside an aspx-file? When I create a new frameset in Visual Studio.Net it just gives me a htm-File. Or give me a link where I can...
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
5
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to...
7
by: Mr Newbie | last post by:
I have written a Custom Control Menu. Its fairly simple but it works well enough. In order to simplify things I decided to store the Menu1 custom control in Session. In the page load event below,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.