Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > FormsAuthentication.SignOut(); doesn't work...

Reply
Thread Tools

FormsAuthentication.SignOut(); doesn't work...

 
 
mo
Guest
Posts: n/a
 
      10-23-2005
my current project uses FormsAuthentocation.. I need a logoff page -

may logo off page contains the following in the Page_Load:
Session.Abandon();

FormsAuthentication.SignOut();

After 'logging off', HttpContext.Current.User.Identity.IsAuthenticated and
Request.IsAuthenticated is still true and the user can still access pages
that they should net be able to..

What's up with this??? I've seen quite a few posts on the web, but no firm
answer



thanks!


 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      10-23-2005
Hello mo,

use a tool like www.fiddlertool.com to check if the cookie is really cleared...


---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> my current project uses FormsAuthentocation.. I need a logoff page -
>
> may logo off page contains the following in the Page_Load:
> Session.Abandon();
>
> FormsAuthentication.SignOut();
>
> After 'logging off',
> HttpContext.Current.User.Identity.IsAuthenticated and
> Request.IsAuthenticated is still true and the user can still access
> pages that they should net be able to..
>
> What's up with this??? I've seen quite a few posts on the web, but no
> firm answer
>
> thanks!
>



 
Reply With Quote
 
 
 
 
mo
Guest
Posts: n/a
 
      10-23-2005
Hey - very nice tool! Thanks!!!

that's exactly the problem, the cookie is not cleared. Therefore the user is
still able to roam about the site - they are never logged off. Another
strange thing is that if a user does log back on, it DOES reset the cookie.
I am not using persistent cookies either...

My login code is below:

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1,
Request.Form["username"],
System.DateTime.Now,
System.DateTime.Now.AddMinutes(30),
false,
userContextElement.OuterXml,
FormsAuthentication.FormsCookiePath
);

// Encrypt the ticket.
string encTicket = FormsAuthentication.Encrypt(ticket);

// Create the cookie.
Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName,
encTicket));

// Redirect to requested url...

???

thanks,
mo



"Dominick Baier [DevelopMentor]" <>
wrote in message news:. com...
> Hello mo,
>
> use a tool like www.fiddlertool.com to check if the cookie is really
> cleared...
>
>
> ---------------------------------------
> Dominick Baier - DevelopMentor
> http://www.leastprivilege.com
>
>> my current project uses FormsAuthentocation.. I need a logoff page -
>>
>> may logo off page contains the following in the Page_Load:
>> Session.Abandon();
>>
>> FormsAuthentication.SignOut();
>>
>> After 'logging off',
>> HttpContext.Current.User.Identity.IsAuthenticated and
>> Request.IsAuthenticated is still true and the user can still access
>> pages that they should net be able to..
>>
>> What's up with this??? I've seen quite a few posts on the web, but no
>> firm answer
>>
>> thanks!
>>

>
>



 
Reply With Quote
 
mo
Guest
Posts: n/a
 
      10-24-2005
Finally!

I found that the 'path' is the culprit in the web.config.

I changed from: 'path="~/" to: path="/" and now it works...

Thanks for the tips on the tools Dominick .



"mo" <> wrote in message
news:...
> my current project uses FormsAuthentocation.. I need a logoff page -
>
> may logo off page contains the following in the Page_Load:
> Session.Abandon();
>
> FormsAuthentication.SignOut();
>
> After 'logging off', HttpContext.Current.User.Identity.IsAuthenticated
> and Request.IsAuthenticated is still true and the user can still access
> pages that they should net be able to..
>
> What's up with this??? I've seen quite a few posts on the web, but no firm
> answer
>
>
>
> thanks!
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57