T
Tony
Hi,
what am I doing wrong ?
there is 2 levels of user accessing the
application:'Admin' and 'NoneAdmin'.
I'm using role based authentication.
some 'Admin' user need to manipulate data on behalf of
some 'NoneAdmin' user, which means that I have an option
where the 'Admin' user, after he is logged in, would
view,save, update,delete other user data) and in order to
allow this "Admin' to manipulate the 'NoneAdmin' data, I
need to change his authentication ticket at runtime
temporarily to let him act as the owner of this data.
here is the code:
Dim tempTicket As New FormsAuthenticationTicket(1,
NoneAdmin_Name, _
DateTime.Today,
DateTime.Today.AddMinutes(180), _
True, "xxxx")
Dim hashTempTicket As String = FormsAuthentication.Encrypt
(tempTicket)
Dim tempCookie As HttpCookie = New HttpCookie
(FormsAuthentication.FormsCookieName(), tempTicket)
tempCookie.Expires = DateTime.Today.AddMinutes(60)
Response.Cookies.Add(tempCookie)
I suppose that this temporary ticket will overwrite the
original one that I saved somewhere before it get
overwritten.
the problem is, that the next request to any page the user
is redirected to the the login page
thank you for any help.
what am I doing wrong ?
there is 2 levels of user accessing the
application:'Admin' and 'NoneAdmin'.
I'm using role based authentication.
some 'Admin' user need to manipulate data on behalf of
some 'NoneAdmin' user, which means that I have an option
where the 'Admin' user, after he is logged in, would
view,save, update,delete other user data) and in order to
allow this "Admin' to manipulate the 'NoneAdmin' data, I
need to change his authentication ticket at runtime
temporarily to let him act as the owner of this data.
here is the code:
Dim tempTicket As New FormsAuthenticationTicket(1,
NoneAdmin_Name, _
DateTime.Today,
DateTime.Today.AddMinutes(180), _
True, "xxxx")
Dim hashTempTicket As String = FormsAuthentication.Encrypt
(tempTicket)
Dim tempCookie As HttpCookie = New HttpCookie
(FormsAuthentication.FormsCookieName(), tempTicket)
tempCookie.Expires = DateTime.Today.AddMinutes(60)
Response.Cookies.Add(tempCookie)
I suppose that this temporary ticket will overwrite the
original one that I saved somewhere before it get
overwritten.
the problem is, that the next request to any page the user
is redirected to the the login page
thank you for any help.