Bug #59438 setting Membership.ApplicationName has no effect
Description:
It appears that Membership is initialized at startup once and for all, and setting Membership.ApplicationName has no effect after that. I'm tracing this to the MySql.Web.General.Application.FetchId(MySqlConnection) method in MySql.Web.dll. It only sets Application.Id once if it's -1. Subsequent changes in Application.Name have no effect.
This behavior differs from Microsoft's SqlMembershipProvider. My application is an "administrator" and I need this functionality. Please refer to http://msdn.microsoft.com/en-us/library/system.web.security.membership.applicationname.asp...
How to repeat:
Setting Membership.ApplicationName does not have an effect.
Suggested fix:
Either:
1. MySql.Web.General.Application.FetchId(MySqlConnection) method in MySql.Web.dll to be changed as:
public int FetchId(MySqlConnection connection) {
MySqlCommand command = new MySqlCommand("SELECT id FROM my_aspnet_Applications WHERE name=@name", connection);
command.Parameters.AddWithValue("@name", this.Name);
object obj2 = command.ExecuteScalar();
this.Id = (obj2 == null) ? -1 : Convert.ToInt32(obj2);
return this.Id;
}
or (more efficient)
2.1 MySql.Web.General.Application.FetchId(MySqlConnection) method in MySql.Web.dll becomes:
public int FetchId(MySqlConnection connection) { return this.Id; }
2.2 public field Application.Name becomes:
private string name;
public string Name {
get { return this.name; }
set {
if(this.name != value) {
this.name = value;
MySqlCommand command = new MySqlCommand("SELECT id FROM my_aspnet_Applications WHERE name=@name", connection);
command.Parameters.AddWithValue("@name", value);
object obj2 = command.ExecuteScalar();
this.Id = (obj2 == null) ? -1 : Convert.ToInt32(obj2);
}
}
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.