Is it OK to modify the session.useragent field to be longer than 100 chars?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StephenKay
    Senior Member
    • Apr 2003
    • 437

    Is it OK to modify the session.useragent field to be longer than 100 chars?

    I like to use the "Who's Online" page to quick check for bots accessing the site.

    I've noticed that in some cases, the useragent field (100 chars) is not long enough to store the part that identifies the robot.

    Case in point:

    I have many googlebots on the site. Checking raw access logs, most of them have this for the user agent:

    Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

    These are correctly identified as googlebot spiders in the who's online.

    However, some of them have this:

    Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

    As you can see, this is far too long for 100 chars and the user agent is truncated before the part that identifies the googlebot; hence, it does not display this as a spider but simply a guest.

    So, can the table field be modified to have more chars, by editing it with phpMyAdmin?

    I read in one post this might not be recommended because the session is stored in RAM and if you had 1000+ users it would be a lot of extra memory, but I rarely have more than 20 to 50 users/spiders at one time.

    And, if modified, will this cause problems in updating later?

  • Paul M
    Former Lead Developer
    vB.Com & vB.Org
    • Sep 2004
    • 9886

    #2
    I assume you are running 3.8.8 or less, as the 3.8.9 upgrader changes it to 255 anyway.
    Baby, I was born this way

    Comment

    • StephenKay
      Senior Member
      • Apr 2003
      • 437

      #3
      Originally posted by Paul M
      I assume you are running 3.8.8 or less, as the 3.8.9 upgrader changes it to 255 anyway.
      Yes, that is correct. So discussions about updating aside, are you saying it's OK for me to modify this field in the sessions table?

      And, since I'm no expert with mySQL and phpMyAdmin, would I just "change" the field and leave the type as VARCHAR and set the length to say 255? Do I need to shut down the forums while doing this? or anything else in particular? Thanks!

      Comment

      • Paul M
        Former Lead Developer
        vB.Com & vB.Org
        • Sep 2004
        • 9886

        #4
        Yes, just change it to 255, leave everything else alone. You dont need to close the forum.
        Baby, I was born this way

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...