Skip to content


Subversion checkout URL

You can clone with
Download ZIP


User Agent DB VARCHAR(120) too short for iPad UA #1090

jdpedrie opened this Issue · 4 comments

5 participants



I found the ticket #463 that made mention that the ci_sessions field for User Agent was increased to 120 characters. This is still too short.

The User Agent on an iPad 2 is similar to the following:

Mozilla/5.0(iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5

It's 138 characters long. I changed my ci_sessions table to VARCHAR(255) and everything is fixed.



It's too short for a LOT of IE user agents strings as well and they can easily go over 250 chars depending on how many versions of .NET are installed. Each .NET update appends additional info to the user string instead of replacing the previous.


If you go to VARCHAR(255), you might as well go all the way to TEXT.

I think a better solution would be to truncate Useragents to 120 characters. Past that, there usually isn't much useful information anyway.


The user agent string IS truncated to 120 characters when used in the Session library.


You don't need to store the whole thing, user agents are getting silly and we could probably store them in TEXT but it's enough for basic matching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.