473,761 Members | 8,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET 2.0 RTM breaks FormsAuthentica tion.SetAuthCoo kie cookie

Another developer and I have noticed that after upgrading to the ASP.NET 2.0
RTM release, when using:
FormsAuthentica tion.SetAuthCoo kie(userName, true)

That the cookie is no longer persisted, even though the flag is set to true
in my call. This only started happening after upgrading from Beta 2 to RTM.
Has anyone else seen this or does anyone else have a workaround?

Thanks,
Bill
Nov 19 '05 #1
8 2647
That's a known bug,search weblogs.asp.net for info.It create 20min
cookie instead.

Reagards.

Nov 19 '05 #2
Could you provide a link for me? I searched bug couldn't find anything on
the topic. I might be searching in the wrong place. Thanks!

Bill
<sa*******@gmai l.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
That's a known bug,search weblogs.asp.net for info.It create 20min
cookie instead.

Reagards.

Nov 19 '05 #3
bob

sa*******@gmail .com wrote:
That's a known bug,search weblogs.asp.net for info.It create 20min
cookie instead.


Does anybody know a work-around for this problem? It is killing me.

RHJ4

Nov 19 '05 #4
Use GetAuthCookie() cookie youself and make it persistent;-)and don't
forget to add it to cookies collection.

Reagards.

Nov 19 '05 #5
Heres the official bug description -
http://lab.msdn.microsoft.com/produc...8-40596bc7197d

Full code for workaround -
http://lab.msdn.microsoft.com/produc...ID=FDBK31991#1

protected void Login1_LoggedIn (object sender, EventArgs e)
{
if ((sender as Login).Remember MeSet)
{
FormsAuthentica tionTicket ticket =
new FormsAuthentica tionTicket(
2,
(sender as Login).UserName ,
DateTime.Now,
DateTime.Now.Ad dYears(50),
true,
"",
FormsAuthentica tion.FormsCooki ePath);
string ticketEncrypted = FormsAuthentica tion.Encrypt(ti cket);

HttpCookie cookie = new HttpCookie(Form sAuthentication .FormsCookieNam e,
ticketEncrypted );
cookie.HttpOnly = true;
cookie.Path = FormsAuthentica tion.FormsCooki ePath;
cookie.Secure = FormsAuthentica tion.RequireSSL ;
cookie.Expires = ticket.Expirati on;

Response.Cookie s.Clear();
Response.Cookie s.Add(cookie);
}
}
Not happy, this is one of a few things going wrong with RTM on my list

Nov 19 '05 #6
I'm confused... in that, Microsoft said it happened in Beta 2 as well but
everything worked fine in Beta 2. Do they still consider this a bug that
will be fixed? It really sucks not having this capability any more. What a
bad user experience it causes for my customers.

"King Adrock" <ki********@gma il.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Heres the official bug description -
http://lab.msdn.microsoft.com/produc...8-40596bc7197d

Full code for workaround -
http://lab.msdn.microsoft.com/produc...ID=FDBK31991#1

protected void Login1_LoggedIn (object sender, EventArgs e)
{
if ((sender as Login).Remember MeSet)
{
FormsAuthentica tionTicket ticket =
new FormsAuthentica tionTicket(
2,
(sender as Login).UserName ,
DateTime.Now,
DateTime.Now.Ad dYears(50),
true,
"",
FormsAuthentica tion.FormsCooki ePath);
string ticketEncrypted = FormsAuthentica tion.Encrypt(ti cket);

HttpCookie cookie = new HttpCookie(Form sAuthentication .FormsCookieNam e,
ticketEncrypted );
cookie.HttpOnly = true;
cookie.Path = FormsAuthentica tion.FormsCooki ePath;
cookie.Secure = FormsAuthentica tion.RequireSSL ;
cookie.Expires = ticket.Expirati on;

Response.Cookie s.Clear();
Response.Cookie s.Add(cookie);
}
}
Not happy, this is one of a few things going wrong with RTM on my list

Nov 19 '05 #7
On 7 Nov 2005 21:11:56 -0800, King Adrock wrote:
Heres the official bug description -
http://lab.msdn.microsoft.com/produc...8-40596bc7197d

Full code for workaround -
http://lab.msdn.microsoft.com/produc...ID=FDBK31991#1


Actually, the workaround is simply to use a large timeout value in your
web.config. No need for this code at all.

This is just a new default for the persistent session, that's all. You can
override it without any new code.

<system.web>
<authenticati on mode="Forms">
<forms timeout="{some big number in minutes}"/>
</authentication>
</system.web>
Nov 19 '05 #8
Erik,

Thank you!

Nov 19 '05 #9

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

Similar topics

2
1548
by: G-Fit | last post by:
Hello group, I use Forms Authentication in my web application and I am not sure I understand the way the cookie works. I use the SetAuthCookie method with a database identifier as userName, as I would like the website to remember who is logged in (and I guess it doesn't matter wether I store a name or an identifier, which is much more convenient for me) :
5
3583
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 ("/" works, or "/mysubdir") or else the auth cookie doesn't get set. I'd like to know why this is necessary. (2) When I call SignOut() the auth cookie is not removed, no matter what I try (no how the cookie is set in the RedirectFromLogin page.
1
1144
by: dotCore | last post by:
Hi, I have VS2003.NET, XP Pro and SQL 2000. The .NET framework is 1.1 The problem I am having with the source code is that I cannot authenticate any user. The sproc returns the user name from database which also means that the user should be authenticated. It runs the SetAuthCookie method with success. The resulting page is no different than the initial page. The login component is still there. When I try to access an admin page directly...
2
2718
by: StanD | last post by:
At the end of my login process I am generating my own Persistent FormsAuthentication ticket. I encode this and set a cookie value. I then use Response.Cookies.Add(cookie), and I continue the login process. The cookie is not persisted across sessions and does not appear in the cookie list on the client. If I use SetAuthCookie persistence works. What am I missing here, in not getting the desired effect with my own ticket? --
2
7033
by: Ben Fidge | last post by:
Is FormsAuthentication.RedirectFromLoginPage the only way to populate the HttpContext.Current.User.Identity.Name property? A base class for each page contains the follwoing property: public int CustomerID { get { try { if (HttpContext.Current.User.Identity.Name != "") return Convert.ToInt32(HttpContext.Current.User.Identity.Name);
0
1958
by: fadi | last post by:
Hopefully someone seen this and knows best way around it. When using FormsAuthentication and using FormsAuthentication.SetAuthCookie, ASP.NET creates a cookie similar to the domain URL. For example, if the user navigates to www.domain.com and logs in, then the cookie is associated with www.domain.com. Even though the user is authentication to the domain, if a link on the site goes to domain.com (without the www), the user is prompted to...
2
3499
by: tshad | last post by:
I have a logon page that is may be called by the Forms Authentication setup. This would put a ReturnURL as part of the URL. I would normally then just issue a: FormsAuthentication.RedirectFromLoginPage(logon.txt,true) But I also am giving them an option to register which would go to a new page. From this page, when they submit, I want to go the original page they were heading for (ReturnURL) when the went to the logon page.
4
8329
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 the users name FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( 1, sUserName, DateTime.Now, DateTime.Now.AddMinutes(20),false,
3
4915
by: David | last post by:
Hi all, I am having a slight issue with FormsAuthentication. I need to authenticate a user and while the page is still being processed, need to work with that authenticated user. I have set up a test page as follows... private void Page_Load(object sender, System.EventArgs e) {
0
10136
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9923
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9811
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8813
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
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 we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.