Hi
During certain periods I want all requests to my site to be redirected, the
only place I can see to do this is in the Session_Start event handler in the
global.asax file but when I try the following:
Session.Abandon();
Response.Redirect( http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot
save it because the response was already flushed by the application.
at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext
context, String id, Boolean& redirected, Boolean& cookieAdded)
at System.Web.SessionState.SessionStateModule.CreateS essionId()
at System.Web.SessionState.SessionStateModule.Delayed GetSessionId()
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source,
EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source,
EventArgs eventArgs)
at
System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)
Obviously I'm not approaching this the right way - any ideas?
Thanks
Kev 10 4287
Try Response.Clear() before
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag
news:dg**********@newsfeed.th.ifl.net... Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following:
Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded)
at System.Web.SessionState.SessionStateModule.CreateS essionId()
at System.Web.SessionState.SessionStateModule.Delayed GetSessionId()
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I'm not approaching this the right way - any ideas?
Thanks
Kev
Tried that, now I'm getting this:
System.Web.HttpException: Session state has created a session id, but cannot
save it because the response was already flushed by the application.
Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message
news:O%****************@tk2msftngp13.phx.gbl... Try Response.Clear() before
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following:
Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded)
at System.Web.SessionState.SessionStateModule.CreateS essionId()
at System.Web.SessionState.SessionStateModule.Delayed GetSessionId()
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I'm not approaching this the right way - any ideas?
Thanks
Kev
And if you try:
Response.Buffer = true;
at the beginning?
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag
news:dg**********@newsfeed.th.ifl.net... Tried that, now I'm getting this:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message news:O%****************@tk2msftngp13.phx.gbl... Try Response.Clear() before
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following:
Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded)
at System.Web.SessionState.SessionStateModule.CreateS essionId()
at System.Web.SessionState.SessionStateModule.Delayed GetSessionId()
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I'm not approaching this the right way - any ideas?
Thanks
Kev
Same.
Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl... And if you try: Response.Buffer = true;
at the beginning? "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... Tried that, now I'm getting this:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message news:O%****************@tk2msftngp13.phx.gbl... Try Response.Clear() before
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following:
Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded)
at System.Web.SessionState.SessionStateModule.CreateS essionId()
at System.Web.SessionState.SessionStateModule.Delayed GetSessionId()
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I'm not approaching this the right way - any ideas?
Thanks
Kev
have you other events in the global.asax?
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag
news:dg**********@newsfeed.th.ifl.net... Same.
Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message news:%2*****************@tk2msftngp13.phx.gbl... And if you try: Response.Buffer = true;
at the beginning? "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... Tried that, now I'm getting this:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in
message news:O%****************@tk2msftngp13.phx.gbl... Try Response.Clear() before
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... > Hi > > During certain periods I want all requests to my site to be > redirected, the only place I can see to do this is in the > Session_Start event handler in the global.asax file but when I try
the> following: > > Session.Abandon(); > Response.Redirect(http://www.site.com) > > I get an error: > > System.Web.HttpException: Session state has created a session id,
but> cannot save it because the response was already flushed by the > application. > > at
System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext> context, String id, Boolean& redirected, Boolean& cookieAdded) > > at System.Web.SessionState.SessionStateModule.CreateS essionId() > > at System.Web.SessionState.SessionStateModule.Delayed GetSessionId() > > at System.Web.SessionState.SessionStateModule.OnRelea seState(Object > source, EventArgs eventArgs) > > at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object > source, EventArgs eventArgs) > > at >
System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplicatio
n.IExecutionStep.Execute()> > at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, > Boolean& completedSynchronously) > > > > Obviously I'm not approaching this the right way - any ideas? > > Thanks > > Kev > >
I have:
App_Start
App_End
Session_Start
Session_End
App_Error
Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message
news:ug****************@TK2MSFTNGP14.phx.gbl... have you other events in the global.asax?
"Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... Same.
Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message news:%2*****************@tk2msftngp13.phx.gbl... And if you try: Response.Buffer = true;
at the beginning? "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag news:dg**********@newsfeed.th.ifl.net... Tried that, now I'm getting this:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application. Kev
"Alexander Widera" <aw**@hrz.tu-chemnitz.de.invalid.de> wrote in message news:O%****************@tk2msftngp13.phx.gbl... > Try Response.Clear() before > > "Mantorok" <no**@tiscali.co.uk> schrieb im Newsbeitrag > news:dg**********@newsfeed.th.ifl.net... >> Hi >> >> During certain periods I want all requests to my site to be >> redirected, the only place I can see to do this is in the >> Session_Start event handler in the global.asax file but when I try the>> following: >> >> Session.Abandon(); >> Response.Redirect(http://www.site.com) >> >> I get an error: >> >> System.Web.HttpException: Session state has created a session id, but>> cannot save it because the response was already flushed by the >> application. >> >> at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext>> context, String id, Boolean& redirected, Boolean& cookieAdded) >> >> at System.Web.SessionState.SessionStateModule.CreateS essionId() >> >> at System.Web.SessionState.SessionStateModule.Delayed GetSessionId() >> >> at System.Web.SessionState.SessionStateModule.OnRelea seState(Object >> source, EventArgs eventArgs) >> >> at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object >> source, EventArgs eventArgs) >> >> at >> System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplicatio n.IExecutionStep.Execute()>> >> at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, >> Boolean& completedSynchronously) >> >> >> >> Obviously I'm not approaching this the right way - any ideas? >> >> Thanks >> >> Kev >> >> > >
Mantorok wrote: Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following: Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
Maybe you need here a
Response.Redirect( http://www.site.com, false);
Or else, don't use Session_Start, but Application_BeginRequest.
Are you sure you *need* that Session.Abandon()?
Hans Kesting
"Hans Kesting" <ne***********@spamgourmet.com> wrote in message
news:uA**************@TK2MSFTNGP14.phx.gbl... Mantorok wrote: Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following: Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
Maybe you need here a Response.Redirect(http://www.site.com, false);
Or else, don't use Session_Start, but Application_BeginRequest.
Are you sure you *need* that Session.Abandon()?
In Beta 2 there is BeginRequest - that's why I'm pulling my hair out lol.
Kev
"Mantorok" <no**@tiscali.co.uk> wrote in message
news:dg**********@newsfeed.th.ifl.net... "Hans Kesting" <ne***********@spamgourmet.com> wrote in message news:uA**************@TK2MSFTNGP14.phx.gbl... Mantorok wrote: Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following: Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
Maybe you need here a Response.Redirect(http://www.site.com, false);
Aha, I just tried that and I get no error now - thank you.
Kev
the default behavior of Response.Redirect is the write the redirct header,
then kill the thread. this is an easy way to stop page processing and the
html output it would generate. killing the thread in Session_Start is not a
good idea, because it too early in the page processing cycle.
you should Redirect(url,false), so the thread is not killed. you then have
to remenber this and stop page processing at a better time.
-- bruce (sqlwork.com)
"Mantorok" <no**@tiscali.co.uk> wrote in message
news:dg**********@newsfeed.th.ifl.net... Hi
During certain periods I want all requests to my site to be redirected, the only place I can see to do this is in the Session_Start event handler in the global.asax file but when I try the following:
Session.Abandon(); Response.Redirect(http://www.site.com)
I get an error:
System.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
at System.Web.SessionState.SessionIDManager.SaveSessi onID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded)
at System.Web.SessionState.SessionStateModule.CreateS essionId()
at System.Web.SessionState.SessionStateModule.Delayed GetSessionId()
at System.Web.SessionState.SessionStateModule.OnRelea seState(Object source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep. SystemWeb.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) Obviously I'm not approaching this the right way - any ideas?
Thanks
Kev
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Agoston Bejo |
last post by:
Hi,
how can one redirect std::cerr into a file? Specifically, if I have an
ofstream object, is there something I can do to make "cerr << ..." calls
write into that particular ofstream object?
...
|
by: Gurikar |
last post by:
How to redirect information to file usinf cerr or clog.
Regards
|
by: Tom Szabo |
last post by:
Hi All,
What I want to achieve is to display a login screen in a certain size and
appearance window with no toolbars etc.
To achieve this I think I need to use redirection, but I am not sure...
|
by: vijaynats |
last post by:
Hi
I created a windows app to run a dos batch file (which takes around
5mins to complete and generates lots of output messages on the console
in the meantime)and i used RedirectStandardOuput to...
|
by: Sune Hansen |
last post by:
Hi guys,
I really hope someone can help me with my problem. Here is the scenario:
I have a development environment on my locale machine. Once in a while when
everything has been tested I...
| |
by: Greg Smalter |
last post by:
Redirecting from page to page within a web project is pretty easy. However,
all Redirect methods take strings as arguments, as if you mistype the string,
you don't find out until run time that you...
|
by: Bendik Engebretsen |
last post by:
Developed this personal WEB site with the new ASP.NET 2.0 Beta:
http://www.techsoft.no/bendik/
It has got this problem: After a while browsing through pictures on the
site, an error occurs:
...
|
by: John Bailey |
last post by:
Okay, I have the Visual Studio 2005 Release Candidate, and it is a great
improvement over Beta 2. My ISP hasn't decided when they will support the
RC, so they are still on Beta 2. I can for the...
|
by: =?Utf-8?B?c3VyZXNocGFuZGk=?= |
last post by:
Hi
I am in a web site A. I want to redirect to a web site B with basic
authentication. HttpWebContext and WebRespose methods are downloading a site
page as html and this is not helping me. I...
|
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,...
|
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...
| |
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...
|
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...
|
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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |