|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Logins.. again :p |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|