473,387 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Membership stuff acts wierd on production server

My site is utilizing asp.net membership. It works perfect on the
development machine.

I copied the entire directory to the production server. Now it seems that
the membership stuff is acting wierd.

I can login ok. But it doesn't run the login redirect properly.

Also, I wrote a simple test page that consists of this...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
response.write("DEBUG:")
For Each role As String In Roles.GetAllRoles
Response.Write(role & ";")
Next

If User.IsInRole("Administrator") Then
Response.Write("admin/manageusers.aspx")
ElseIf User.IsInRole("Engineer") Then
Response.Write("engineer/manageprojects.aspx")
ElseIf User.IsInRole("Non-Engineer") Then
Response.Write("membersonly/mycivcast.aspx")
Else
Response.Write("default.aspx")
End If
End Sub

On my local dev machine it spits out all the roles (from the For statement.)
In the production server it doesn't spit out ANY roles, even though the
web.config's both point to the production server mysql db.

Any ideas? Thanks.
Oct 21 '08 #1
2 1525
I have been recently developing with the membership provider and found
this snippet of code very useful in determining if I was correctly
authenticated as a user. This might give you some insight as to
whether or not you are actuall authenticating correctly. I added it
to my default page and got the login page to redirect me.

FormsIdentity id = (FormsIdentity)User.Identity;
FormsAuthenticationTicket ticket = id.Ticket;

Response.Write("<p/>TicketName: " + ticket.Name);
Response.Write("<br/>Cookie Path: " + ticket.CookiePath);
Response.Write("<br/>Ticket Expiration: " +
ticket.Expiration.ToString());
Response.Write("<br/>Expired: " + ticket.Expired.ToString());
Response.Write("<br/>Persistent: " +
ticket.IsPersistent.ToString());
Response.Write("<br/>IssueDate: " +
ticket.IssueDate.ToString());
Response.Write("<br/>UserData: " + ticket.UserData);
Response.Write("<br/>Version: " + ticket.Version.ToString());

Hope this is of some use.

Jason.
Oct 21 '08 #2
Thanks Jason.

I'm thinking this has to do with the fact that I am using custom
membership/role providers (because I am using CoreLabs MyDirect.NET to
access the MySQL database.)

In my web.config I have it setup as this...

<membership defaultProvider="AspNetMySqlMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<remove name="AspNetMySqlMembershipProvider" />
<add name="AspNetMySqlMembershipProvider"
type="CoreLab.MySql.Web.Providers.MySqlMembershipP rovider"
connectionStringName="MySqlServices" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
requiresUniqueEmail="true" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"
description="MyDirect membership provider" applicationName="/AmtekCivCast "
minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" />
<add name="PasswordResetProvider"
type="CoreLab.MySql.Web.Providers.MySqlMembershipP rovider"
connectionStringName="MySqlServices" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="false"
requiresUniqueEmail="true" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"
description="MyDirect membership provider" applicationName="/AmtekCivCast "
minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" />
</providers>
</membership>
<roleManager defaultProvider="AspNetMySqlRoleProvider" enabled="true"
cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="90"
cookiePath="/" cookieProtection="All">
<providers>
<remove name="AspNetMySqlRoleProvider" />
<add name="AspNetMySqlRoleProvider"
type="CoreLab.MySql.Web.Providers.MySqlRoleProvide r"
connectionStringName="MySqlServices" />
</providers>
</roleManager>
<!--<anonymousIdentification enabled="true"/>-->
<profile defaultProvider="AspNetMySqlProfileProvider">
<providers>
<remove name="AspNetMySqlProfileProvider" />
<add name="AspNetMySqlProfileProvider"
type="CoreLab.MySql.Web.Providers.MySqlProfileProv ider"
connectionStringName="MySqlServices" />
</providers>
<properties>
<!-- <add name="ZipCode" /-->
</properties>
</profile>

I'm thinking that I have to add these entries to the
<system.data>/<DbProviderFactoriessection, but I don't really know how
yet.

Sound right?

Thanks!

"Jason James" <ja***@dive-master.orgwrote in message
news:f1**********************************@q35g2000 hsg.googlegroups.com...
>I have been recently developing with the membership provider and found
this snippet of code very useful in determining if I was correctly
authenticated as a user. This might give you some insight as to
whether or not you are actuall authenticating correctly. I added it
to my default page and got the login page to redirect me.

FormsIdentity id = (FormsIdentity)User.Identity;
FormsAuthenticationTicket ticket = id.Ticket;

Response.Write("<p/>TicketName: " + ticket.Name);
Response.Write("<br/>Cookie Path: " + ticket.CookiePath);
Response.Write("<br/>Ticket Expiration: " +
ticket.Expiration.ToString());
Response.Write("<br/>Expired: " + ticket.Expired.ToString());
Response.Write("<br/>Persistent: " +
ticket.IsPersistent.ToString());
Response.Write("<br/>IssueDate: " +
ticket.IssueDate.ToString());
Response.Write("<br/>UserData: " + ticket.UserData);
Response.Write("<br/>Version: " + ticket.Version.ToString());

Hope this is of some use.

Jason.

Oct 21 '08 #3

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

Similar topics

11
by: Bozo Schmozo | last post by:
Greetings! I've searched groups.google.com already to see if I can determine if using PHP/MySQL (if needed) for a web site I wish to develop. As the subject indicated, it will be a content...
8
by: VB Programmer | last post by:
I would appreciate your assistance on this ASP.NET 2.0 site.... This is the wierd problem: While accessing the built in .NET functions for 'profiling' or 'membership' an error is generated (see...
1
by: kvr901 | last post by:
I've been trying to use this "custom membership provider" stuff for several days, and am totally lost. I am building an ASP.NET (vb) application on a laptop. Then I copy the files to a Win 2003...
3
by: ryan.mclean | last post by:
Hello everyone, I am wondering, can the membership provider be changed at runtime? Perhaps the connectionStringName? I would like to use a different database based on the server the site is...
0
by: Alias | last post by:
Hi - I have a site that runs on a development and production server. I'd like to programmatically change the connection string the provider uses in the web.config file and have the provider use...
0
by: PinkBishop | last post by:
Question regarding the ASP.NET 2.O Membership / Role component The following works fine on local machine and networked dev box. ASP.NET Membership protecting files and folders. I am trying...
5
by: Mahernoz | last post by:
Hi Everyone! I have a problem here. I have used the latest asp.net membership & profiles functionality in my site. I have 2 roles admin and user. I also have a user named admin. Now, my...
1
by: =?Utf-8?B?aGZkZXY=?= | last post by:
Hello, I have a web application that makes use of the SQL Membership and Role providers. My app has admin screens to manage users (membership), roles, and supplementary user data. I have just...
5
by: nadeaupn | last post by:
Hi, I followed the instructions contained in the articles named : Deploying ASP.Net 2.0 Web site to Production Server: Part I (URL :...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.