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 8 2647
That's a known bug,search weblogs.asp.net for info.It create 20min
cookie instead.
Reagards.
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. 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
Use GetAuthCookie() cookie youself and make it persistent;-)and don't
forget to add it to cookies collection.
Reagards.
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
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
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> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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) :
|
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.
|
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...
|
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?
--
|
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);
| |
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...
|
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.
|
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,
|
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)
{
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |