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 January 29th, 2005, 11:54 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
Logging out first user

If a user has two accounts, they are on one, then get on the other, and do something that updates the database, sometimes it uses the first users info/details.. how can i change it so it logs out the first person if someone logs in after them on the same comp/different comp?

Reply With Quote
  #2  
Old January 30th, 2005, 10:26 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
Set some sort of cookie to identify each user who logs in. Then track this as a session variable as well. Then when the user tries to do something you can compare the session variable to the cookie variable, and if they are different, you know that you're dealing with a different user.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old January 30th, 2005, 04:29 PM
erikd erikd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: NYC
Posts: 81 erikd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 19 sec
Reputation Power: 5
Along with this, I was wondering how to log out a user if you use cookies and sessions to track a user without the need to close the browser. If I need to start a new post on this, I will, but I thought it went along with the previous question.

I know you can use the following when the browser closes, because the cookie is gone, and closing the browser closes out the session, but what about when you just want to switch to a different user without closing the browser first:
<cfcookie expires="NOW" name="UserID" value="#cookie.UserID#">

Reply With Quote
  #4  
Old January 30th, 2005, 09:39 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,661 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 14 h 23 m 22 sec
Reputation Power: 53
In that case they would have to click a "logout now" link, similiar to how most web sites like yahoo or gmail do it.

Reply With Quote
  #5  
Old February 1st, 2005, 04:52 PM
erikd erikd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: NYC
Posts: 81 erikd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 19 sec
Reputation Power: 5
Just in case anyone wanted to know what I did to solve the problem of logging out a user through both cookies and sessions.

<cfif isDefined('form.logout')><cfcookie expires="NOW" name="UserID" value="#cookie.UserID#"><cfloop collection=#session# item="i">

<cfset StructDelete(session,i)>

</cfloop>
<cflocation url = "somepage.cfm" addtoken="no">
</cfif>

This deletes all sessions, which you sometimes might not want. I image you could set

<cflock timeout=20 scope="Session" type="Exclusive">
<cfset StructDelete(Session, "Items")>
</cflock>

to delete a certain session variable, although I have not tested this. Can anyone confirm that you can choose which sessions to delete using this method, or are u stuck deleting all sessions?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Logging out first user


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 6 hosted by Hostway