Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Membership and createUser

Status
Not open for further replies.

agentwalker

Programmer
Jun 10, 2007
31
GB
i'm using the membership class to create a new use like so
Membership.CreateUser(username,password);

All this is working fine however once it creates the user it setting there online status to true. SO on another page the new user is showing up as online.

Any ideas how I can stop it from making the user appear online directly after being created ?

Had a google the only thing I can find is a suggestion to set the userIsOnlineTimeWindow to something like 20 in the web.config then after crating the user set there 'LastLoginbDate' to -20. However this doesn't appear to be logging the user out.

I've checked the database and the loginDate is getting set back 20 mins and the userIsOnlineTimeWindow is set to 20 so not sure.

Any sugestions ?
 
Think I might have answered my own question here.

Also changed the LastActivityDate in the Users table and that seems to do the trick.
 
Bit of a follow on question.

I'm trying to use the Membership.GetUser() to check if the new user i'm trying to enter has a matching loginName with an existing user and if so force them to pick another.

However it seems that Membership.GetUser is case sensitive so I could register some with a username of "joeBlogs" then with the new user enter "joeblogs" and it won't detect that the username already exists.

In the database I can see theres a LoweredUserName field so why is this method not making use of this instead of the UserName field ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top