doutui7955 2011-08-29 12:38
浏览 6

谁在线会话统计

I have a MySQL table called "sessions", that contains a session_id, user_id, ip_address, and last_updated field.

I have the following questions:

  1. What's the best way of updating the "sessions" table if the user has not visited the site before, or if the user navigates to a different page?

  2. If a users navigates to a page that requires them to be logged in, what's the best way of remembering the page that they were viewing, prior to them being redirected to the login page, so that they can be returned to it after logging in?

  3. How do I calculate the total number of members/guests currently online, and the total members/guests for the day, even if users of the same computer use different web browsers?

  4. I want to display how many users/guests are viewing a certain page. What's the best way of keeping track on what page the user is currently on.

Any help is greatly appreciated. I've been scratching my head about the above for some time!!! ;)

  • 写回答

3条回答 默认 最新

  • doulan0297 2011-08-29 12:47
    关注
    1. any way that suit you. Personlly I prefer SQL query
    2. Show login form in place, with no redirects
      • a trivial SQL query with count(*)
      • noway with session stats table
      • doesn't matter. 2 browsers means 2 clients
    3. Another field in your sessions table.
    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?