To begin with, it's not used in core. It's not feasible to implement it for any key-value store (memcache. apc, whatnot). So... why it is there?

CommentFileSizeAuthor
no_session_count.patch4.59 KBchx
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brianV’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +smallcode

+1 for getting rid of this.

If someone really needs it, it can easily be added in via a contrib module, or a few lines of code in a custom block.

Dries’s picture

I'm OK with removing this functionality. Will commit unless someone objects.

sun’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

errrrr. admin_menu uses this function, and it really helped that we improved it for D7.

chx’s picture

Status: Closed (won't fix) » Reviewed & tested by the community

There is a small problem: the function is unusable. In D6 there were some optimizations to not start a session for first visitors (aka googlebot) but in D7 the optimization is much heavier: unless you need a session you wont get one. So the function is totally and absolutely useless to count your anon visitors because (unless you destroy the performance increase) it will typically be 0. If you pick (and you should) another way to do stats, well it's easier to make that discern between anon and auth visitors.

sun’s picture

It seems I have to copy + paste.

sun’s picture

Copy + paste the current code from D7 into admin_menu to at least count auth users, I meant.

catch’s picture

http://api.drupal.org/api/function/user_block_view/7 is already using its own custom query for this. Completely unrelated side note, I'd like to see there issue where s.timestamp vs user.access was considered faster, seems like we could save a DISTINCT there.

Dries’s picture

So, we OK with removing this then?

sun’s picture

Yes it seems so. chx told me that there's almost nothing to count for anonymous users in D7, which was done elsewhere. While that is probably cool for performance, it's not really cool for modules that want to do something with anonymous visitors. Most likely, we need a dedicated contrib module to bring back some kind of new stats.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Alright, committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -smallcode

Automatically closed -- issue fixed for 2 weeks with no activity.