473,405 Members | 2,187 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,405 software developers and data experts.

Calling FormsAuthentication.SignOut() after calling Response.Flush

I know that this is something of an old chestnut. Nevertheless, my problem is
as follows;

I have a page in which I write html out to the client using
Response.Write(), followed by Response.Flush(). On the same page, I have a
logout button that, when clicked, calls FormsAuthentication.SignOut() (after
which a redirect to a page in another app occurs). As you can guess, clicking
on this button raises the following exception;

"Server cannot modify cookies after HTTP headers have been sent."

Does anybody have any ideas about how I get around this?

Thanks,
Martin

Nov 18 '05 #1
1 1914

Hi Martin,

I did not understand exactly what you are trying to do. Do you write the
Response back with Response.Write() and flush it with each request? Then when
do you do the sign out? Can you give a small example of what you are doing?
(maybe a code partical?)

Ethem
"Martin Lee" wrote:
I know that this is something of an old chestnut. Nevertheless, my problem is
as follows;

I have a page in which I write html out to the client using
Response.Write(), followed by Response.Flush(). On the same page, I have a
logout button that, when clicked, calls FormsAuthentication.SignOut() (after
which a redirect to a page in another app occurs). As you can guess, clicking
on this button raises the following exception;

"Server cannot modify cookies after HTTP headers have been sent."

Does anybody have any ideas about how I get around this?

Thanks,
Martin

Nov 18 '05 #2

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

Similar topics

5
by: Jeff Johnson | last post by:
I'm using forms authentication to protect a subfolder within my site. I've got it working fine except for two issues: (1) When I do a RedirectFromLogin page I have to put a cookie path ("/"...
2
by: George Durzi | last post by:
When you call FormsAuthentication.SignOut(), is the FormsAuthentication cookie supposed to be destroyed automatically? I'm creating my FormsAuthentication cookie by doing: HttpCookie oCookie =...
0
by: Ed West | last post by:
Hello This SignOut code is not working, any ideas? TIA. public class logout : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) { FormsAuthentication.SignOut();...
4
by: Matthias S. | last post by:
Hi there, I've created an application which is using Forms-based authentification. My Login-Button event handler looks somewhat like this: // validate the input, etc... // sUserName holds now...
9
by: Patrick Olurotimi Ige | last post by:
When i add the following code below to a userControl it doesn't fire. Any ideas? Sub SignOut(ByVal objSender As Object, ByVal objArgs As EventArgs) FormsAuthentication.SignOut()...
3
by: Mark Olbert | last post by:
FormsAuthentication.SignOut() removes the authorization ticket from a user (and the user's roles), but does not change the user's identity. I need to be able to either revert the user to the...
2
by: parez | last post by:
Hi ALl, I had problem with FormsAuthentication.SignOut(). It wasnt working. Looked arround and saw a lot of posts and different solutions to the problem. And some how (i dont nkow what...
3
by: c83 | last post by:
Hi everyone!! I have a litle problem with an ASP.net application. My default.aspx page can be accessed only by the registered users. after user signs-out, it is transfered to the login.aspx...
1
by: jobs | last post by:
Hello. I have asp.net menu with a logout item. I handle the the menu click as follows: Protected Sub Menu_MenuItemClick(ByVal sender As Object, ByVal e As...
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?
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...
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
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
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...

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.