EdomGroup: Inspire, Innovate, Create

Viewing by month: October 2008

Screwy CF admin action setting the password

ColdFusion

Ok, so I'm trying to change the password on my ColdFusion install to something that includes tags (< and >). In the admin it say's the password has been updated ok but when I logout an try it it's still set to the old one. If I remove either of the < or > characters it works. Now here is the best part, I've had a password with both those characters before but I set it on install of ColdFusion when it was accepting the password from a shell prompt (command line for you Windows users). I'm thinking that whatever encryption or validation algorithm is being run in the admin is failing but not actually throwing an error. Does anyone know what's going on or have seen this before?

Passing cookie values in cfhttp

ColdFusion

If you've ever tried to access a site using cfhttp and that site is expecting a cookie from the browser such as a user id you might be supprised to see cfhttpparam has a type="cookie" attribute. You'll probably be even more supprised when you realize that doesn't work.

The other day I was trying to write a script to access a site that, once logged in, sipmly checked the value of a userid cookie. So, I logged in with firefox and grabbed the value of that cookie and threw is in as

<cfhttpparam type="cookie" name="userid" value="01234">

Read more...

Result of COUNT in query of queries

SQL

This is an interesting litle tidbit to keep in mind. What do you get if you count distinct against a table with no records? Here is the example query,

SELECT COUNT(DISTINCT ID) AS UniqueRecords FROM MyTable

If MyTable does not contain any records it will return a result set with a single record with a value 0. Now, what do you get if MyTable is actually a query and you're performing a query of queries? Well, if MyTable is a query with no records then you'll have no records in the result, not a 0 value.

Removing time from datetime via casting

SQL

Sometimes you want to compare a datetime value without the time portion to a date. If you use query param and specify a timestamp for the type but only provide a date as the value you'll be given 00:00:00 for the time, which is midnight. To strip, or more specifically, set the time porition of the value in the database or midnight also use this cast:

CAST(FLOOR(CAST(DateCompleted AS FLOAT)) AS DATETIME)

Read more...

Categories

Monthly Archives

Feeds