ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 March 11th, 2013, 12:31 PM
blobula blobula is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 20 blobula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 37 sec
Reputation Power: 0
ColdFusion redirect to https for certain pages

Hello,

I'm trying to make certain pages redirect to https using ColdFusion in the application.cfm file. This works to a certain extent but the problem is when the page redirects to https the browser pops up the question wanting to know if you want to display 'All Content'.

I take it this means that there is a page or content that is not secure which is causing the browser to pop up this message. Any idea how to get around this if files are scattered all over the place and are pulled in by cfincludes, script tags in other file, etc....

I'm on CFMX7

Reply With Quote
  #2  
Old March 11th, 2013, 02:04 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
You can tell which page elements are not using HTTPS by looking at the network panel of Firebug or the Chrome dev tools.

As far as making them use HTTPS if they have HTTP hardcoded into the URL, there's no easy option. This is one reason people use relative or absolute paths rather than a full URL (e.g. "/images/myImage.jpg" instead of "http://myserver/images/myImage.jpg")

If you must have the full URL, it's typical to see an application determine the current protocol from the CGI scope at the start of a request and store it in a variable (like "currentProtocol" or whatever). Then, all images, scripts, etc. use that variable in their URLs (e.g. src="#currentProtocol#://myserver/images/myImage.jpg").

Reply With Quote
  #3  
Old March 11th, 2013, 02:34 PM
blobula blobula is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 20 blobula User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 37 sec
Reputation Power: 0
What about script tags that contain JavaScript? For instance, when the site loads all the files are loaded under the protocol of http://

When the user click the sign in link a popup login page comes up that switches to https:// Once that happens the links on the login page stop working because it's controlled by Javascript which didn't switch over to the https protocol because it is contained in a different file.

Reply With Quote
  #4  
Old March 11th, 2013, 03:13 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
The same rules apply to JavaScript code: use absolute or relative URLs, and avoid hardcoding the full URL with protocol. If the full URL is required, dynamically build the URL based on the current protocol.

Unfortunately there's no magic solution for this, and it applies to every web application ever written that needs to dynamically switch between protocols.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > ColdFusion redirect to https for certain pages

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap