ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2005, 04:25 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
Logins.. again :p

Okay on my site, i have users who register multiple accounts (who knows why).. then login to them all, at once (again why?).. what im wondering if there was a way so once they login to one account, then when they try to login to the second it logs them out of the first...

i was told on another forum you cannot do this. they said you just do something like:

<cfif sessions exists>
welcome back person
<cfelse>
show the login form
</cfif>

i dont want to do it like this.. all they would have to do is logout, open multiple windows, and login to their many accounts again.. so please is there a way? MOST sites on the internet don't let you login to 2 accounts at once, so i figure there is a way in coldfusion... i tried doing something like this so it kinda logs them out before they can login.. but i dont really know what im doing - any ideas???




<cfquery name="qVerify" datasource="aeris7282">
SELECT *
FROM registration_info
WHERE email = '#email#'
AND user_pass = '#user_pass#'
</cfquery>


<cfif qVerify.RecordCount>
<cfscript>
StructClear(session);
</cfscript>
<cfset session.allowin = "True">
<cfset session.user_id = qVerify.user_id>


<cflocation url="/members_only.cfm">

<cfelse>
Wrong email or password.. go back and try again
</cfif>

Reply With Quote
  #2  
Old February 5th, 2005, 05:19 PM
NightVa NightVa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 67 NightVa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 31 m 33 sec
Reputation Power: 5
Check for a value that can only exist on the one machine...

I would make a suggestion of putting the value of the remote computer IP address into a client structure.

If their IP is read and saved, they would have to have another computer on a different ISP to log in to more than one account on your site.

I believe one possible bit of code is:

<cfset CLIENT.yourStructureName = StructNew()>
<cfset CLIENT.yourStructureName.remoteMachine = CGI.REMOTE_ADDR>

Of course you must enable 'client management' in your APP template.

On log out you can either clear or delete their particular CLIENT structure using this bit of code:

<cfset StructClear(CLIENT.yourStructureName)> or <cfset StructDelete(CLIENT, "yourStructureName")>

Nathan

Reply With Quote
  #3  
Old February 7th, 2005, 09:44 AM
VelvettFogg VelvettFogg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 34 VelvettFogg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 13 m 46 sec
Reputation Power: 4
I think you need to be careful of Nathan's idea. Right now Im at work, and we have a proxy. Anyone from my office who would log in to your site would show the same IP as anyone else from my office.

I wonder if you could do this with a cookie? Plop a cookie on the machine with the first login -- on subsequent logins, check for that cookie, if the username in that cookie does not match the one they are trying to log on with -- do something

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Logins.. again :p


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway