Welcome Guest, Not a member yet? Register   Sign In
CI sessions trimming user agent
#5

[eluser]llbbl[/eluser]
mysql
"Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions."
http://dev.mysql.com/doc/refman/5.0/en/char.html

mssql
varchar Variable-length data with a maximum of 8,000 characters
http://www.databasejournal.com/features/...hp/2212141

oracle
"Variable-length character string having maximum length size bytes or characters. Maximum size is 4000 bytes or characters, and minimum is 1 byte or 1 character. You must specify size for VARCHAR2."
http://www.acs.ilstu.edu/docs/oracle/ser...htm#i54330

db2
"A variable-length character string. The range of n is 1 to 32 672 characters."
http://www.ispirer.com/doc/sqlways38/Out...1-089.html


Any others you think worth mentioning? I don't think removing the trim code is absolutely necessary. It does seem like pretty much all the varchar types remove trailing whitespace. So it looks like they only whitespace to worry about is any that precedes the data, which I'm not quite sure why its a concern in the first place. If you echo out $_SERVER['HTTP_USER_AGENT']; there isn't ever any preceding white space that I see.

I would be happy with either:
1) increasing trim length to 255
2) removing trim

The only time that it would ever be a problem is if you have preceding whitespace + user agent that is more than 255. That is a lot of white space. The only argument for keeping trim and increasing length that I can see is if there are any user agents commonly in use that are near the 255 character limit.


Messages In This Thread
CI sessions trimming user agent - by El Forum - 09-27-2008, 05:29 PM
CI sessions trimming user agent - by El Forum - 09-27-2008, 09:34 PM
CI sessions trimming user agent - by El Forum - 09-28-2008, 09:02 AM
CI sessions trimming user agent - by El Forum - 09-28-2008, 09:32 AM
CI sessions trimming user agent - by El Forum - 09-28-2008, 10:18 AM
CI sessions trimming user agent - by El Forum - 09-28-2008, 10:19 AM
CI sessions trimming user agent - by El Forum - 09-28-2008, 11:11 AM
CI sessions trimming user agent - by El Forum - 09-28-2008, 11:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB