Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Security (http://www.velocityreviews.com/forums/f62-asp-net-security.html)
-   -   Response redirect Doesnt Work (http://www.velocityreviews.com/forums/t765460-response-redirect-doesnt-work.html)

dave 11-26-2003 07:38 PM

Response redirect Doesnt Work
 
Why oh why doesnt this work???


I have a simple forms authentication that all works fine, ie it validates
user details against a db.

When i try to redirect it goes off to nowhere.

eg - code snippet:

FormsAuthentication.SetAuthCookie(dat("USER_ID"), AutoLogin.Checked)
Context.Response.Redirect("index.aspx")
'and tried just Response.Redirect("index.aspx")

Both of which look like they are going off somewhere, but never reach the
desired page. I have also tried the following within the <HTML> tag, but
still the same result?

if User.Identity.IsAuthenticated then
response.redirect("index.aspx")
end if


This is driving me totally nuts!

Hope someone can help.





Randy Charles Morin 11-27-2003 05:26 AM

Re: Response redirect Doesnt Work
 
Have you tried calling Response.End after the redirect? I do it out of
habit, don't know if it actually makes a dif.

Randy
http://www.kbcafe.com

"dave" <dave@edin.co.uk> wrote in message news:<#Ts7iTFtDHA.560@TK2MSFTNGP11.phx.gbl>...
> Why oh why doesnt this work???
>
>
> I have a simple forms authentication that all works fine, ie it validates
> user details against a db.
>
> When i try to redirect it goes off to nowhere.
>
> eg - code snippet:
>
> FormsAuthentication.SetAuthCookie(dat("USER_ID"), AutoLogin.Checked)
> Context.Response.Redirect("index.aspx")
> 'and tried just Response.Redirect("index.aspx")
>
> Both of which look like they are going off somewhere, but never reach the
> desired page. I have also tried the following within the <HTML> tag, but
> still the same result?
>
> if User.Identity.IsAuthenticated then
> response.redirect("index.aspx")
> end if
>
>
> This is driving me totally nuts!
>
> Hope someone can help.


Raj Lealh 11-28-2003 05:51 PM

Re: Response redirect Doesnt Work
 
This problem is driving me nuts too!!

Response.End does not work either. :0(

I've seen some strange things happen. I do have a version that works...

But when I use a web service to authenticate (called when submitting
username and password), the call to:

Response.Redirect(
FormsAuthentication.GetRedirectUrl(txtUserName.Tex t,
false));

does not work, but just loops on the login page.

Is there anyone that knows why?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

dave 11-29-2003 10:55 AM

Re: Response redirect Doesnt Work
 
FOUND IT!

The reason in my case was SmartNavigation="True" was set at the top of the
login.aspx page - soon as i removed it - it starting working.

Hope this helps others......




"Raj Lealh" <rlealh@utnet.utoledo.edu> wrote in message
news:uOyt7gdtDHA.2932@TK2MSFTNGP11.phx.gbl...
> This problem is driving me nuts too!!
>
> Response.End does not work either. :0(
>
> I've seen some strange things happen. I do have a version that works...
>
> But when I use a web service to authenticate (called when submitting
> username and password), the call to:
>
> Response.Redirect(
> FormsAuthentication.GetRedirectUrl(txtUserName.Tex t,
> false));
>
> does not work, but just loops on the login page.
>
> Is there anyone that knows why?
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!




Raj Lealh 11-30-2003 08:44 PM

Re: Response redirect Doesnt Work
 
I found the problem was due to the size of the cookie (> 4.0 KB)

I was trying to populate the cookie with group names retrieved from
parsing through Windows 2000 Active Directory. The size of the output
(xml) was too big, just over 4.0 kb, since I retrieved all nested groups
that the user belonged to.

I ended up implementing forms authentication without cookies, and now it
works fine. You just have to put in a few extra measures to deal with
security of the mangled URL... ;o)

example of mangled url (contains session id in brackets):

http://myserver.edu/(weQWerw34534532456)/admin.aspx

Interesting.. eh?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT. The time now is 11:11 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.