Meteor framework - How to logout user after 5 minutes of innactivity - meteor

maybe I was not looking so deep, but I did not found the information in Meteor framework Docs, how and where I can set the time to logout user after for example 5 minutes of innactivity.
Q1:
I’m using the “accounts-ui#1.3.1” package. I found the possibility to set “loginExpirationInDays”: 0.05, but It not works correctly, because the login will expire sooner like expected. It seems to be, that loginExpiration time does not extend during working with the app.
Q2:
Also, how can I calculate 5 minutes. Calculate proportion of the day? With this way, it not works.
1 hours is 1/24 = 0.041
30 min is 0.041/2 = 0.020
5 min = (0.041/60)*5 = 0,003417
I set 0.05 and it’s about 10minutes, If I will set lower value than 0.04, it not works.
I’m asking to understand and make me clear, how It works and how can I setup correctly the expiration and how can I solve the problem with noextend expiration time, when I’m using the app.
Thanks for each answer.

You can create a cron-job at the server side (e.g msavin:sjobs) which run every minute and clear the services.resume.loginTokens from the users you want to force to logout.

Many of your concerns are discussed in great detail in this forum post.
tl;dr
You can use this package or that one.
Cheers!

adel, thank you very much for your recommendation, I was created a thread also in Meteor forum: https://forums.meteor.com/t/how-to-logout-user-after-5-minutes-of-innactivity/54342/16
I was searching, for the solution, the "zuuk" solution is working but not solving the situation, if same user is logged more than one time with more tokens. Also don't logout user on close browser window/tab.
Therefore, I was created own new package acqsk:account-token-expiration, but I don't know, If I'm thinking with right way, because It's my first Atmosphere package: https://gitlab.com/acqsk/account-token-expiration
Thanks a lot for the answer.

Related

How can I change the graph interval in Live Metrics Stream

The current interval of 1 second and max of 60 seconds is too small and issues may be missed.
When viewing the live metrics stream page of Application Insights the interval on all graphs are 1 second, and it only goes up to 60 seconds. I am trying to use this as a monitoring page to keep an eye on recently released or updated function apps. For this I need to be able to change the interval to view more data at once without having to keep watch on it. Right now if we don't keep watch on it every minute we may miss something important.
I have searched the Microsoft documentation, the git repository, stackoverflow, and various other sites trying to find my answer but the only thing I found was from over 4 years ago and I would hope that this has changed since then.
Live Metrics Stream allows to peek at what's going one right now with 1 second resolution. But it doesn't persist data anywhere. So, data is only stored in UX (browser) and right now only for 60 seconds.
For bigger intervals it might make sense to refer to other Application Insights experiences (including Analytics).

Add many routes using Google Maps Directions Service Over Query Limit

I have an application that requires having many (sometimes over 50) dynamic routes added to the google map. Using the DirectionsService, I am able to add right around 10 routes or so before the requests start to fail with the status of "Over Query Limit". I was wondering if anyone has encountered this situation and has found a way to deal with it. It seems that even if I pause between requests, I am still failing for anything over the first 10. Not sure if there is a request limit for a single map instance?
Any help with this would be much appreciated!
According to the documentation, you can only get up to 2 requests per second. If your code do that slower than 2 per second, that should be fine.
I used the setInterval(function(){.... to test it and yup, if you do it slow enough it seems to work.
http://jsfiddle.net/bd1qdLv3/

ASP.net / VB.net / SQL Server : change variables without page request

I'm stuck with building my own, simple browser game.
My program: you can upgrade your tools which allow you to gain more points per hour.
My problem:
So for example a user logs in and upgrades his tools from 0 to 1 which would double the amount of points gained. But upgrading takes 2 hours to complete. I don't expect my user to be online for 2 hours so I save the time he was last seen in an SQL table. Now when 2 hours have passed the amount of points gained need to be doubled but it's very possible that the user doesn't visit the page for another 10 hours. So my current program keeps adding 1 point per hour until the user visits the page. So in this case he'd have 12 points. But it needs to multiply after 2 hours so he needs to have 22 points.
Another, maybe simpler example is a maximum amount of points. Let's say the max is 10 points. But the user stays offline for 15 hours which means he'd earn 15 points at a rate of 1pnt/hr.
I don't have any functionally code yet because I want to know if something like this is actually possible and how for example cityVille(facebook) does it.
Now my question:
Can anyone give me a tip or give me some info on how to get started at this or at least give me the name of what I'm searching for? I've tried google'ing things like "offline database interactions" or "changing variables without user request" but nothing useful comes up.
Thanks in advance,
BlaDrzz.
You can schedule jobs with SQL server. These jobs can run at whatever frequency you like.
http://technet.microsoft.com/en-us/library/ms191439.aspx

Using Firebase clock to timestamp changes

We have a dataset in Firebase updated by multiple clients.
We want to track the last modified on datetime of the dataset. We cannot rely on the client setting the modified on datetime as their local clock can be totally out of sync.
Is there a way I could have Firebase tag timestamp to a dataset based on its clock to track last modified on?
We're working on some features to support this at the moment, but we don't have a way to do this right now. Note, however, that the IDs created by "push()" are chronologically-ordered, and we compensate for client-side clock skew as best we can when we create them, so if all you're trying to do is make sure some writes to a list occur in order, you can do that with push().
I'd be interested in hearing how you'd like this feature to look. If you have a sec I'd appreciate an email to andrew at firebase...
Update: Firebase now supports setting server timestamps as well as accessing the server time directly on the client. See the documentation here:
https://www.firebase.com/docs/managing-presence.html
We're on the same boat... and I guess sooner or later, many firebase clients will have this issue, as it's a "new kind" of problem we never had to face in the old "client-server" days.
Out current solution (still in the making) is to estimate the time difference between the client and OUR server on initialization, and them compensate,
So - where we had x = new Date(),
it is now x = ourDateService.now()
our now() function simply does new Date() + diff
This works for us,as we don't need millisecond accuracy, and it's a single-page-app that loads once, so we can do this diff-check and initialize ourDateService on load, but this solution will not work for everybody (ofcourse, you can store it in the localstorage/cookie and revalidate every day or so).

Drupal 6: Heartbeat module is "missing" some content

I’m using the heartbeat module on my site to make an activity-stream and recently I discovered that it doesn’t display all the new comments.
I’ve displayed group messaging ‘cause I only want to display #username commented on #node_title and nothing more. But for some reason, when there is several comments submitted within a short range of time it either only displays one of the comments or nothing or it makes an entry in the activity-stream which is just blank.
Before I was using the built-in comment-template in Heartbeat but now I’ve tried to create my own instead. It works when I post a comment but when testing it and makes two comments within e.g. 30 seconds it still makes the error.
Are there any known problems with this issue or am I missing something?? I haven’t detected the problem with adding new nodes, which also can occur within a short period of time on my time.
Thanks
Sincere
- Mestika
If you are having display failures in Views, there is a patch someone worked out in February 2012 for Views 6.x-3.x - you might want to try that. It fixes the display for a bunch of fields. See http://drupal.org/node/1295570

Resources