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:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 24th, 2004, 12:55 AM
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
Weirdness with hyperlinks and cflocation

Hi all,

I created 4 pages all in the same directory.
1. Application.cfm
2. loginForm.cfm
3. loginAction.cfm
4. adminIndex.cfm

The login form sends input data to the action page which checks the inputs against a query. The query joins three tables and fills session structure variables with data.
I then check inside the action page with CFOUTPUT to see if the variables were filled and they are.

THEN I have a link on the bottom of the page that links to the adminIndex.cfm template. The adminIndex.cfm template will then check to see if the session variables are defined.

Here's the problem: If I use the hyperlink, the variables are NOT defined. Then if I changed the link to a CFLOCATION tag the session variables ARE defined!

Can someone please explain why this happens?
That way I can do it right the first time...

thanks,
Nathan

Reply With Quote
  #2  
Old August 24th, 2004, 08:14 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 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 10 h 8 m 55 sec
Reputation Power: 53
Look at your cfapplication tag, are you specifying that session cookies be used? I bet you are not. When you do the URL link, your cfid and cftoken are not passed so the application doesn't know what your session is. By default cflocation will pass the id and token, so the application does know which session you have.
__________________
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 August 24th, 2004, 09:39 AM
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
You're right....No cookies were set in the App file.

But there are two choices. SetDomainCookies and SetClientCookies.

Which is the correct one and why the choice?

Nathan

Reply With Quote
  #4  
Old August 24th, 2004, 11:40 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 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 10 h 8 m 55 sec
Reputation Power: 53
Both will work, but domain cookies work across multiple servers in a cluster, while the other is server-specific.

Reply With Quote
  #5  
Old August 27th, 2004, 11:37 AM
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
An issue one step further...

How can I programatically get rid of CFIF and CFTOKEN on the server once I've deleted the structure in my logout page?

I want to use the ID and TOKEN ONLY while the structure is active NOT after the structure is deleted. Right now if I save the URL with the ID and TOKEN, I can go directly to that secured page as if I never logged in. This is a bad security risk in secured pages.

I also use CFHEADER tags to prevent caching but the saved ID and TOKEN bypass that...

Any ideas?
Nathan

Reply With Quote
  #6  
Old August 27th, 2004, 01:15 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 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 10 h 8 m 55 sec
Reputation Power: 53
You need to handle this yourself by comparing a "logged in time" with the current time, and only letting them back in if they haven't exceed the timeout period. I believe the cflogin tag does this automatically, or you can handle it yourself if you have your own authentication system.

Note that this would happen on any system that was passing an id to identify the current user and facilitate session management. In other words, it's a general web application issue and not just a CF issue.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Weirdness with hyperlinks and cflocation


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