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

Session ending without any warning!

Hi everybody,

I am using ASP.NET 2.0.

When redirecting from page1 to page2 using Response.Redirect() method
ThreadAbortException is raised.

In my condition sometimes even though this exception is caught and handled
by my code, the session_end method in global.asax is getting called, which
implies that all my sessions are ended and hence i am forced to login once
again!

Can somebody please let me know what i am missing here, any solution to
avoid this error...

Thanks and Regards.
Jul 12 '07 #1
4 1242
"Arti" <ar**@yasutech.comwrote in message
news:ep**************@TK2MSFTNGP05.phx.gbl...
When redirecting from page1 to page2 using Response.Redirect() method
ThreadAbortException is raised.

In my condition sometimes even though this exception is caught and handled
by my code, the session_end method in global.asax is getting called, which
implies that all my sessions are ended and hence i am forced to login once
again!

Can somebody please let me know what i am missing here, any solution to
avoid this error...
The Response.Redirect method has an overload whereby you tell it not to
abort the thread:
http://msdn2.microsoft.com/en-us/lib...dt(VS.80).aspx

I'm not convinced that this will solve the problem, though, because it
certainly shouldn't be tearing down your session...

Worth a try in the first instance, though...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 12 '07 #2
"Arti" <ar**@yasutech.comwrote in message
news:ep**************@TK2MSFTNGP05.phx.gbl...
Hi everybody,

I am using ASP.NET 2.0.

When redirecting from page1 to page2 using Response.Redirect() method
ThreadAbortException is raised.

In my condition sometimes even though this exception is caught and handled
by my code, the session_end method in global.asax is getting called, which
implies that all my sessions are ended and hence i am forced to login once
again!

Can somebody please let me know what i am missing here, any solution to
avoid this error...
I'm not sure this is the same I have seen, but if you redirect to another
page while the first page still has an open database connection, this may be
the result. So make sure everything is cleaned up before redirecting to
another page. Then you will not get that exception at all.

Bjorn
Jul 12 '07 #3
Thanks Mark, I tried that one out but it doesn't work... :(

Hi Bjorn,
The problem is that this problem occurs only in certain conditions... Do you
still think this solution will solve the problem?

Regards
Arti.

"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:Pu*********************@telenor.com...
"Arti" <ar**@yasutech.comwrote in message
news:ep**************@TK2MSFTNGP05.phx.gbl...
>Hi everybody,

I am using ASP.NET 2.0.

When redirecting from page1 to page2 using Response.Redirect() method
ThreadAbortException is raised.

In my condition sometimes even though this exception is caught and
handled by my code, the session_end method in global.asax is getting
called, which implies that all my sessions are ended and hence i am
forced to login once again!

Can somebody please let me know what i am missing here, any solution to
avoid this error...

I'm not sure this is the same I have seen, but if you redirect to another
page while the first page still has an open database connection, this may
be the result. So make sure everything is cleaned up before redirecting to
another page. Then you will not get that exception at all.

Bjorn

Jul 16 '07 #4

"Arti" <ar**@yasutech.comwrote in message
news:Ol**************@TK2MSFTNGP03.phx.gbl...
Thanks Mark, I tried that one out but it doesn't work... :(

Hi Bjorn,
The problem is that this problem occurs only in certain conditions... Do
you still think this solution will solve the problem?
I don't know, depends on the details in your conditions. Let's say you
retrieve database records, and sometimes you encounter unexpected values
like dbNull where there is supposed to be a number. If this situation isn't
taken into the code, you may get an exeption that escapes the open thread.
There are all sort of possibilities in this direction, but since I don't
know anything about the app or the conditions when this happens, I am only
guessing.

Bjorn
Jul 17 '07 #5

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

Similar topics

4
by: Bob | last post by:
Seem to have a problem ending a session. I get the following message. Warning: session_start(): Cannot send session cookie - headers already sent by (output started at...
6
by: Donnie | last post by:
can session variable hold objects that can later be reference by other pages? if so, i get an "incomplete object" error when i try to call methods from the object I have stored in the session. any...
0
by: Craig Morey | last post by:
I run Apache2 and PHP5 and most of the time it works fine with my scripts. Then occasionally, and it doesn't seem to make any difference when, I'll get php session errors, saying that that...
14
by: Darrin J Olson | last post by:
I am trying to end a session for a site without having to completely close the browser to end it. When I access the site and log in it works fine. If I log out and in with a different account...
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...
5
by: news.microsoft.com | last post by:
Hi everyone, I need some help (may be in the form of some sample code) for the subject question. I have an ASP.NET/C# application. I need to do quite a few tasks when the session ends. I...
0
by: Shaun | last post by:
Hi all, I'm trying to implement a custom session handler that writes session data to a MySQL database. It works fine about 99% of the time. Trouble is, at random intervals, I get entries like...
10
by: stathisgotsis | last post by:
Hello everyone, I am having a brain fart or something, why won't this work? test.php: <?php session_start(); $_SESSION='test'; header("Location: test2.php"); exit();
6
by: Ken Varn | last post by:
When I am running my ASP.NET 2.0 application using VS.NET 2005 ASP.NET Development Server, the session state seems to be getting lost at various times without warning. I am not sure why this is...
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
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.