473,770 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EventArg s) Handles Me.Load
response.write( "DEBUG:")
For Each role As String In Roles.GetAllRol es
Response.Write( role & ";")
Next

If User.IsInRole(" Administrator") Then
Response.Write( "admin/manageusers.asp x")
ElseIf User.IsInRole(" Engineer") Then
Response.Write( "engineer/manageprojects. aspx")
ElseIf User.IsInRole(" Non-Engineer") Then
Response.Write( "membersonl y/mycivcast.aspx" )
Else
Response.Write( "default.as px")
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 1537
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;
FormsAuthentica tionTicket ticket = id.Ticket;

Response.Write( "<p/>TicketName: " + ticket.Name);
Response.Write( "<br/>Cookie Path: " + ticket.CookiePa th);
Response.Write( "<br/>Ticket Expiration: " +
ticket.Expirati on.ToString());
Response.Write( "<br/>Expired: " + ticket.Expired. ToString());
Response.Write( "<br/>Persistent: " +
ticket.IsPersis tent.ToString() );
Response.Write( "<br/>IssueDate: " +
ticket.IssueDat e.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 ="AspNetMySqlMe mbershipProvide r"
userIsOnlineTim eWindow="15">
<providers>
<remove name="AspNetMyS qlMembershipPro vider" />
<add name="AspNetMyS qlMembershipPro vider"
type="CoreLab.M ySql.Web.Provid ers.MySqlMember shipProvider"
connectionStrin gName="MySqlSer vices" enablePasswordR etrieval="false "
enablePasswordR eset="true" requiresQuestio nAndAnswer="tru e"
requiresUniqueE mail="true" passwordFormat= "Hashed"
maxInvalidPassw ordAttempts="5" passwordAttempt Window="10"
description="My Direct membership provider" applicationName ="/AmtekCivCast "
minRequiredPass wordLength="5" minRequiredNona lphanumericChar acters="0" />
<add name="PasswordR esetProvider"
type="CoreLab.M ySql.Web.Provid ers.MySqlMember shipProvider"
connectionStrin gName="MySqlSer vices" enablePasswordR etrieval="false "
enablePasswordR eset="true" requiresQuestio nAndAnswer="fal se"
requiresUniqueE mail="true" passwordFormat= "Hashed"
maxInvalidPassw ordAttempts="5" passwordAttempt Window="10"
description="My Direct membership provider" applicationName ="/AmtekCivCast "
minRequiredPass wordLength="5" minRequiredNona lphanumericChar acters="0" />
</providers>
</membership>
<roleManager defaultProvider ="AspNetMySqlRo leProvider" enabled="true"
cacheRolesInCoo kie="true" cookieName=".AS PROLES" cookieTimeout=" 90"
cookiePath="/" cookieProtectio n="All">
<providers>
<remove name="AspNetMyS qlRoleProvider" />
<add name="AspNetMyS qlRoleProvider"
type="CoreLab.M ySql.Web.Provid ers.MySqlRolePr ovider"
connectionStrin gName="MySqlSer vices" />
</providers>
</roleManager>
<!--<anonymousIdent ification enabled="true"/>-->
<profile defaultProvider ="AspNetMySqlPr ofileProvider">
<providers>
<remove name="AspNetMyS qlProfileProvid er" />
<add name="AspNetMyS qlProfileProvid er"
type="CoreLab.M ySql.Web.Provid ers.MySqlProfil eProvider"
connectionStrin gName="MySqlSer vices" />
</providers>
<properties>
<!-- <add name="ZipCode" /-->
</properties>
</profile>

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

Sound right?

Thanks!

"Jason James" <ja***@dive-master.orgwrote in message
news:f1******** *************** ***********@q35 g2000hsg.google groups.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;
FormsAuthentica tionTicket ticket = id.Ticket;

Response.Write( "<p/>TicketName: " + ticket.Name);
Response.Write( "<br/>Cookie Path: " + ticket.CookiePa th);
Response.Write( "<br/>Ticket Expiration: " +
ticket.Expirati on.ToString());
Response.Write( "<br/>Expired: " + ticket.Expired. ToString());
Response.Write( "<br/>Persistent: " +
ticket.IsPersis tent.ToString() );
Response.Write( "<br/>IssueDate: " +
ticket.IssueDat e.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
3888
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 based site with videos - NO, it's not a porn site though. I thought that I'd list the key requirements/specifications for my web site below and was wondering if some of you'd be so kind as to provide your thoughts on each and comment on them with...
8
2262
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 following 2 examples): ---- EXAMPLE 1 -------- OK --> Dim p As New ProfileCommon OK --> p = Profile.GetProfile(Me.ddlRacer.SelectedItem.Text) FAILS --> Me.lblDebug.Text = p.FirstName.ToString
1
291
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 Server machine. Just for testing I created a BLANK SQL Server 2000 database on the server (its only purpose it to try out using the membership stuff). I ran the aspnet_regsql thing and it created a bunch of tables and stored procedures...
3
3282
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 on. I suppose that a custom provider could be used to accomplish this, is there another way?
0
3772
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 the updated string. I am able to successfully change the string using this code in the Application_Start method of the Global.asax file: Dim csNew As ConnectionStringSettings
0
1635
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 to run the Membership component. I have loaded to production where host is running Win2k Server, IIS 5, ASP.NET 2.0, SQL Express
5
2909
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 website is running perfectly, but i want to deploy it.
1
2948
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 deployed the application to a production server. My Question: How do I create the initial Admin role and user in the clean/unpopulated database that has the Membership and Role schema on this production server?
5
2092
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 : http://www.c-sharpcorner.com/uploadfile/dsdaf/104012006083052am/1.aspx) Deploying ASP.NET 2 Web Site to Production Server: Part II (URL : http://www.c-sharpcorner.com/UploadFile/dsdaf/104092006022507AM/1.aspx)
0
10257
Oralloy
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...
1
10037
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,...
0
9904
tracyyun
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...
0
8931
agi2029
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...
1
7456
isladogs
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...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
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...
1
4007
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
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.