Wernon Posted December 17, 2018 Report Share Posted December 17, 2018 I am creating a new Application and found one issue. I need to check a number of registered and unregistered users visiting my DataPages. Question: How can I track the user logins to the DataPages? Quote Link to comment Share on other sites More sharing options...
0 MayMusic Posted December 17, 2018 Report Share Posted December 17, 2018 To track the number of logins, you can create a submission page which is based on a table with the following fields: User_ID (text 255), DateSubmitted (Timestamp) . This DataPage should be Authenticated and the destination after submission should be the page you want to redirect users to when they login. Make User_ID a hidden field which is receiving value from authentication and then add HTML block at the end of element list and use this code to auto submit the page This page will be used as login page and since it is being auto-submitted user info will first get saved to the table and then user will be redirected to destination. Quote Link to comment Share on other sites More sharing options...
0 techguy Posted December 25, 2018 Report Share Posted December 25, 2018 Hi MayMusic, I am trying to create a presence (user logged in) and timestamp of login for users. I am curious if this would be the same thing for me, but I cannot make this work. I created a submission page, created a table for the login and timestamp, user ID etc, but I must be doing something wrong. Any help would be appreciated... Quote Link to comment Share on other sites More sharing options...
0 Harbinger Posted January 26, 2019 Report Share Posted January 26, 2019 Hi @techguy I think it would be better to create a separate post for that question, so other user can also see your case and help you further. With regards to your work flow, If you are looking for a timestamp to stamp the date and time when the user logs in your application, you can add a timestamp field in the configuration of your authentication. Maybe I can help you further if you can elaborate. Regards, ~ H Quote Link to comment Share on other sites More sharing options...
0 NiceDuck Posted September 25, 2019 Report Share Posted September 25, 2019 Hello I have followed MayMusics advise and it works for me. You may also use this with the Caspio's redirect base on user's level so can still track records even if you have multiple user level. You will need two data pages though. I will simplify my workflow with this pattern Login--> auto submision form for tracking log in records --> html datapages with JS for redirecting. You can refer to this page if you want information about the multiple user level redirection: https://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/ hope it helps anyone. quack Quote Link to comment Share on other sites More sharing options...
0 Shiro Posted September 25, 2019 Report Share Posted September 25, 2019 Hey MayMusic, Hey NiceDuck Your workflows are terrific. Thank you so much. I modified your workflow a little to also record the log out date/time of the user . first, I added another text field 255 in my table. This will be our indicator if the user logged in or logged out on that certain time. Then, I made another auto submission form similar to what MayMusic describes, the only difference is the new text field 255 which has an auto value of 'Log out'. Note that you have to add this field to the auto submission form you are using for your log-in and make its auto value a 'Log in'. Then we make it redirect to the logout link. Its going to make a lot of redirection though, specially if your authentication has an auto redirection somewhere too. Thank you again. Quote Link to comment Share on other sites More sharing options...
0 NiceDuck Posted September 27, 2019 Report Share Posted September 27, 2019 Hey Shiro I do have a similar workflow too for my log out. However, I noticed that on your workflow, the log in values will be recorded separately with its log out records. Unless you have a reason for separating those values, I suggest that you try this workflow. Add a text 255 field on your User accounts table (the table which has the log in credentials of the users). I named mine as 'track_id' Note that If you are using a view for your authentication, please include this newly added field to your view. The table where you record the log values should have the following fields: * log_id -- any ID field *for me, I used an GUID *Log in time -- Date/time field *Log out time -- Date/time field * user_id -- text field. Make report details page. Use your table for log records as a data source. Data selection, select "Filter data based on your pre-defined criteria" ---> "Allow parameters in search criteria" ---> Bridge parameters only. Restrict the record based on user identity (Record Level Security) set the identity field in Authentication to the 'track_id' then set the matching field in current data source as 'log_id' dont select any fields for your Select Filtering Fields. The record level security will do the filtering itself. Select only the log out time field on fields for results. set it to hidden with timestamp value Dont forget to apply the JS for auto submit. For Destination and Messaging , select "go to a new page" then write your log-out URL. Also, Note that in your auto submission form for your log-in, you have to stamp the users ID into the user_id field. Then you'll need a trigger for your table for log records that activates upon insert. The goal of this trigger is to copy the 'log_id' to the 'track_id' in your user account table. to summarize this story, what i did was Log-in --> autosubmision form which records the login time and user id on the table for log records --> HTMLpages with JS for redirecting '-->Also, the trigger will then look at whose user has log in and update his copies the log id to this users track_id field Log-out --> details page which locate the right Log records using the value on the users track_id field via record level security filtering --> timestamp the logout time to logout field --- redirect to log-out link. I hope you try it Shiro. Quack Quote Link to comment Share on other sites More sharing options...
0 Shiro Posted September 27, 2019 Report Share Posted September 27, 2019 That workflow looks "Nice"Duck hahaha however, I'm only on explore plan so triggers are not available to me. Thank you though Quote Link to comment Share on other sites More sharing options...
0 Mikey Posted October 28, 2019 Report Share Posted October 28, 2019 Hi NiceDuck, I am building this out this week but have a question.... How do you handle if the user closes the browser instead of "logging" out of the app? Just curious if there is an auto log out function or some other way to handle this or does it matter? Thank you Quote Link to comment Share on other sites More sharing options...
0 Vitalikssssss Posted October 30, 2019 Report Share Posted October 30, 2019 Hi @Mikey, I believe that it won`t be possible to track logging if the user close the browser. This type of behavior requires server side programming which is not available in Caspio. Perhaps you will be satisfied with standard feature called User Logs. Regards, vitalikssssss Quote Link to comment Share on other sites More sharing options...
0 crionsynx Posted March 5, 2020 Report Share Posted March 5, 2020 I'm trying to go with the solution suggested by NiceDuck but I'm stuck in the Data selection part of Details Report. Quote I cannot see the "Allow parameters in search criteria" option. Quote Link to comment Share on other sites More sharing options...
0 vanderLeest Posted August 31, 2020 Report Share Posted August 31, 2020 I would love to have a bit more detailed advice from NiceDuck too. I'm stuck at the same point. Quote Link to comment Share on other sites More sharing options...
0 vanderLeest Posted November 12, 2020 Report Share Posted November 12, 2020 NiceDuck's suggestion works for my app only to a certain extent. Sadly, the log-out time is stored against the previous Session_ID of the user. It appears that the authentication routine stores the status of the fields in the authentication table at the moment of authentication, and not refreshes them after the Session_ID gets updated (in my case via a trigger). I track the user's login via a hidden Auto Log In page in the T_User_Log table. I have a trigger on insert in that T_User_Log table that copies the random Session_ID into its equivalent in the T_User table. Next, I have a Log Out page that should put a timestamp in the Log table for this Session_ID. The solution is to create a View (in my case Q_Current_User_Sessions) based on the T_User and T_User_Log tables. Inner Join the tables on both their respective User_ID and Session_ID fields and set the latter to be editable. Fields to include are Log_User_ID, Log_Session_ID and Log_Out_Time (without criteria). Design the DP User_Log_Auto as a Details Report, select Q_Current_User_Sessions as the source, and require authentication. Restrict record access based on User_ID identity matching Log_User_ID. Set no filters, and select Log_Out_Time as the only field for the Details Page. Hide Log_Out_Time to receive on load the system parameter Timestamp. Hide the form with a style in the Header and add an HTML Block at the bottom of the page elements with an auto-submit script. After record update, close the window, and - voila - we have working (and hidden) User_LogOut_Auto page. Quote Link to comment Share on other sites More sharing options...
0 Flowers4Algernon Posted March 30, 2023 Report Share Posted March 30, 2023 Hello! If you want to view the authenticated users that logged into your application, you may want to look into this feature: https://howto.caspio.com/logs/app-access/ Quote Link to comment Share on other sites More sharing options...
0 Aether Posted September 22, 2023 Report Share Posted September 22, 2023 Hello! Caspio released a new enhancement to the Logs feature, now the time shown in the Log date column is aligned to the time zone selected in your account settings. Source: https://howto.caspio.com/release-notes/caspio-42-0/caspio-42-0/#:~:text=Enhancements to Logs Quote Link to comment Share on other sites More sharing options...
0 Kronos Posted January 26 Report Share Posted January 26 Hi, Just to add here. If you want to download App Access Logs, you may use this method Quote Link to comment Share on other sites More sharing options...
0 PotatoMato Posted March 8 Report Share Posted March 8 I also suggest voting on this feature: https://caspio.uservoice.com/forums/164206-caspio-bridge/suggestions/47666825-add-app-access-log-download so the Caspio team can include this feature on future releases where we can download the logs. -Potato Quote Link to comment Share on other sites More sharing options...
0 Kronos Posted October 23 Report Share Posted October 23 Hi! Sharing this here Quote Link to comment Share on other sites More sharing options...
Question
Wernon
I am creating a new Application and found one issue. I need to check a number of registered and unregistered users visiting my DataPages.
Question: How can I track the user logins to the DataPages?
Link to comment
Share on other sites
17 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.