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 July 12th, 2005, 10:26 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
CF Login security

Hey all,

Everything i've done and everywhere I read it seems that the idea of the CFlogin, loginuser, etc tags are used to stop a person from getting to a page without a proper username and password, which is fine.

So as an example...user tries to get to Page A user is not logged in, therefore the forceuserlogin fires and a login screen appears...you enter a username/password and you now have access to all pages that require a username/password.

I know and understand that you can add roles to add the functionality of allowing people to only see certain pages, etc etc.

What i'm trying to do is make it so User A goes to Login.cfm enters their username/password and gets sent to a URL in the database.

So, user A goes to Page A, user B goes to Page B, but user A can't go to Page B...

I think all I need help with is the first page, user A being sent to page A once logged in...limiting where they can go after that I think I know how to accomplish...

Thanks!

Reply With Quote
  #2  
Old July 12th, 2005, 11:04 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
Something I don't understand...

what i've been trying to do is use CFlocation to send the user to a page once they are logged in...so...

after this code

<CFLOGINUSER
Name="#GetUser.id#, #GetUser.username#"
Password="#Form.UserPassword#"
Roles="">
add
<cflocation url="whatever">

now, for some reason if I do that, and send the user to a page, they aren't logged in...say I send the user to cnn.com...and then from cnn.com try to jump back to a protected page it won't work.

but, if I take away the cflocation tag and take away the action tag from the login screen page with the CGI_script name to tell the browser that the action is to the page the user was attempting to access...the code will just put you inside the page you are attempting to access, IE. you want to go to admin, once logged in puts you in admin.

And once you are logged in you can access any of the pages that access requires, because you're logged in.

So to review, why is adding the cflocation tag after the login code screw everything up?

Thanks

Reply With Quote
  #3  
Old July 12th, 2005, 11:37 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 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 16 h 33 m 51 sec
Reputation Power: 53
Not sure, but one idea is that using cflocation is redirecting the user before the cookie is set (assuming you are storing the login info in a cookie in the cfapplication tag or application.cfc file)?
__________________
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
  #4  
Old July 12th, 2005, 11:38 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
any suggestion of how to work around that?

Reply With Quote
  #5  
Old July 12th, 2005, 11:50 AM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
nevermind, i've got an idea.

Reply With Quote
  #6  
Old July 12th, 2005, 11:51 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 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 16 h 33 m 51 sec
Reputation Power: 53
You can set the login storage to session. That's if the cookie issue is the problem.

Reply With Quote
  #7  
Old July 12th, 2005, 12:02 PM
Caden Caden is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 272 Caden User rank is Private First Class (20 - 50 Reputation Level)Caden User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 8 m 8 sec
Reputation Power: 4
The Workaround.

What you suggested is probably the smarter move...but I got it working the way I want, and this is how I did it.

I hardcoded the script to send the users to a particular page...inside that page I have a GetAuthUser() script to pull the ID of the user...then I use that id to grab the url field in the database and a cflocation to send them to that location.

It isn't pretty...but it worked.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > CF Login security


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
Stay green...Green IT