SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Session help

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Session help

    I have a site that makes a log of certain things that happen.
    If the user logs in it says user logged in at whatever time.
    The problem is if two users are logged in a the same time then their activity is logged together and it gets mixed up
    eg
    UserA logged in at 12:15:33
    UserB logged in at 12:18:45
    UserA updated contentA at 12:16:00
    UserA added a new item at 12:18:14
    UserB updated contentB at 12:18.35
    UserB logged out 12:20:03
    UserA logged out 12:21.02

    can i create a session to store the data together before it is output in the log file so they are grouped together
    ie $_SESSION['user-log'] .= $variableMessage
    to create a better log file like below

    UserA logged in at 12:15:33
    UserA updated contentA at 12:16:00
    UserA added a new item at 12:18:14
    UserA logged out 12:21.02

    UserB logged in at 12:18:45
    UserB updated contentB at 12:18.35
    UserB logged out 12:20:03

    Regards, Pierce

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,994
    Mentioned
    100 Post(s)
    Tagged
    0 Thread(s)
    Could you please post the code that your using to generate the log text and save it to the log
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Member
    Join Date
    Feb 2012
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not quite sure how you would be able to do this unless you store the data in a db then run a job to sort the data during the export.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •