Our application requires users to be able to access certain pages only after they've completed other pages on our site. So i add roles to the users account after they've finished certain things. The code I use is below. The problem that recently started was that the role gets added immediately, but the user can't access a page until 30 seconds to a minute after the role was added.
It worked before, but over the past few days i've noticed that this isn't happening immediatley any more. Are there any host settings that need to be set for this to work? Any suggestions would be great. We are using version 04.04.01. And I'm using vs 2003 to program it.
Thanks,
Gregg
This code fires on a cmdUpdate click event.
Dim objCtlRole As New DotNetNuke.Security.Roles.RoleController Dim objRoleInfo As New DotNetNuke.Security.Roles.RoleInfoTrue) Dim arrPortalRoles() As String = objCtlRole.GetRolesByUser(UserId, PortalId) Dim strPortalRoles As String = String.Join(";", arrPortalRoles) Dim RolesTicket As New System.Web.Security.formsAuthenticationTicket(1, UserInfo.Username, DateTime.Now.AddHours(-1), DateTime.Now.AddHours(-1), False, strPortalRoles) Dim strRoles As String = System.Web.Security.formsAuthentication.Encrypt(RolesTicket)' send roles cookie to client
Response.Cookies("portalroles").Value = strRoles
Response.Cookies("portalroles").Path = "/"
Response.Cookies("portalroles").Expires = DateTime.Now.AddHours(-1)
End If
DataCache.ClearPortalCache(PortalId,