472,779 Members | 2,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 software developers and data experts.

Endless loop on delete auth cookie/abandon session

Hello all,

Not sure I can describe this adequately, but I am creating an endless loop
when an authenticated user signs out.

When the user signs out, I want to remove authentication, abandon session,
and redirect to default page. I need to use a custom cookie (I track separate
logins to multiple "companies"), so afaik can't use the standard
formsauthenication routines to create/delete the default ticket/cookie.

Here's the code to sign out:
...
login.DeleteAuthCookieEmail()
Session.Abandon()
Response.Redirect(MyURL.Default)
...
Public Shared Sub DeleteAuthCookieEmail()
Dim cookie As HttpCookie = New HttpCookie(GetAuthCookieName)
cookie.Expires = DateTime.MinValue
HttpContext.Current.Response.Cookies.Add(cookie)
End Sub

Here's code to create the cookie:
Public Shared Sub SetAuthCookieEmail(ByVal Email As String)
Dim cookie As HttpCookie = New HttpCookie(GetAuthCookieName)
cookie.Expires = DateTime.MinValue
cookie.Value = Email
HttpContext.Current.Response.Cookies.Add(cookie)
End Sub

(GetAuthCookieName just returns a company-specific string for the cookie
name).

When I delete my authentication cookie and then do the redirect, it
continues to run that block of code over and over. If I don't do the
redirect, it ends fine, which makes me guess that the removal of
authentication is "stuck" somewhere.

Anyway, I think I'm missing something fundamental with sessions, cookies,
tickets, and forms authentication, but just don't see it. All thoughts are
much appreciated.

tia,

Bill Borg

Nov 19 '05 #1
0 2112

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

Similar topics

4
by: jsWalter | last post by:
I have an extension Class to Auth and I'm looking for some folks to hammer on it a bit and give feed back. Class: AuthUser - add user (well, Auth does that now, so its gone) - remove user...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
5
by: Param R. | last post by:
Hi all, we are experiencing an issue with regards to the auth cookie and a load balanced server farm. The user may randomly hit any box in the server farm. If the users authenticates against 1 box...
1
by: Daniel Michaeloff | last post by:
Hi all, I have an application that when finished redirects to a non-ASP.NET app which is choking on a huge ASP.NET session cookie. The cookie "ASP.NET_SessionId" gets transmitted by the browser...
15
by: Edwin Knoppert | last post by:
I have searched but info is limitted. In my test app i used a non persistant cookie for forms authentication. slidingExpiration is set to true On run and close and rerun the login remains ok....
23
by: Phil Powell | last post by:
// OBTAINED FROM http://www.javascripter.net/faq/settinga.htm // NOTE THAT IF YOU SET days TO -1 THE COOKIE WILL BE SET TO YESTERDAY AND THUS EXPIRE function setCookie(name, value, days, docObj)...
5
by: ad | last post by:
Hi, How can I delete the cookie in client?
3
by: tdavisjr | last post by:
Hi, Does anyone know how to force asp.net authentication to create a new session cookie after using the FormsAuthentication.SignOut() method. ASP.NET_SessionId is the name of the session cookie...
4
by: J. Frank Parnell | last post by:
The goal here is to use basic authentication for a user to log in, but keep a cookie so that they dont have to log in every browser session. <? $user = "user"; $pass = "pass"; ...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.