Session Expiry VB.NET 1 Day - asp.net

I am building an internal intranet system, that will call up sales orders and I need it to remember the last sales order number they were looking at, even though I could put this in a database and call up the info I was wondering if I could use a session cookie for a longer time than 20 minutes I want to set the expiry to expiry time to a day or a week or so;
Session("SalesOrder") = 105793 'STORE THIS FOR A DAY OR WEEK
I hope you can help.

Related

Google Analytics, Count of Sessions

EDIT
This post indicates that sessions should be interpreted as visitors for that hour.
Using the graph to identify which hour has the highest traffic and record
the number of visitors for that hour
I am looking at a Google Analytics report (Audience --> Overview) for a website. In section Audience --> Overview, I have selected Sessions vs. Select a metric. I have specified a frequency of Hourly.
I mouse clicked on a peak and saw
Thursday, January 17, 2019 10:00
Sessions:19,732
Is this telling me that I had 19,732 concurrent sessions open at 10:00? Or that in the hour between 9:00 and 10:00, that 19,732 sessions had been opened (and many likely closed)? Please note that
Avg. Session Duration = 00:09:07
I looked at How Count of Sessions is calculated and that leads me to believe that the 19,732 sessions is for the hour between 9:00 and 10:00.
Can someone confirm this?
Thank you.
Yes, that number would represent how many sessions were started during that hour.
You shouldn't interpret sessions as visitors/users. As one user can have many sessions during that hour. By default, max of 2 (new session at say the 5th minute, no activity, come back at the 35th minute, session 2).

Google Analytics: How to compare real-time vs yesterday?

In the REAL-TIME / Overview page, you can see how much people are currently browsing your site. Although, how do you know if this current value is good or bad? I would like to know how much people were browsing my site the same time the day before, so I would know if I have 5% more or less people.
Also, how would I know if the site is doing it better or worse than 1, 2 or 5 hours before? The REAL-TIME shows the last 30 minutes of per minute page-views, but how do I know if the site is going down or up compared to a few hours before? 30 minutes is not enough.
Is there any add-on to add, custom modification to make, or free/paid service to complement?
You want to use the standard ("core") reporting. The dimensions that will help you are (UI / API):
Hour / ga:hour: A two-digit hour of the day ranging from 00-23 in the timezone configured for the account. This value is also corrected for daylight savings time. If the timezone follows daylight savings time, there will be an apparent bump in the number of sessions during the changeover hour (e.g., between 1:00 and 2:00) for the day per year when that hour repeats. A corresponding hour with zero sessions will occur at the opposite changeover. (Google Analytics does not track user time more precisely than hours.)
Hour of day / ga:dateHour: Combined values of ga:date and ga:hour formated as YYYYMMDDHH
Date Hour and Minute / ga:dateHourMinute: Combined values of ga:date, ga:hour and ga:minute formated as YYYYMMDDHHMM
Hour Index / ga:nthHour: The index for each hour in the specified date range. The index for the first hour of the first day (i.e., start-date) in the date range is 0, for the next hour 1, and so on
With the UI you can add a secondary dimension to reports or build custom reports, with the API you can need to build your requests from scratch (try the explorer, official API doc).

Update logout time and duration

I am using ASP.NET and want to calculate the difference between two times. Actually, I had a scenario to calculate the difference between the login and logout times.
For example, in organizations there is some particular limit for working hours. So if a user logs in at 9:00 AM in the morning and logs out at 5:00 PM in the evening, we need to calculate how much duration he stayed in the office (which is 8 hours in the present scenario ).
But I want to do this in ASP.NET. I calculate the duration between the two times but the problem is that:
if the first day I log in at 09:10:15 and log out at 17:20:55, the duration time is 08:10:40
if the second say I log in at 09:00:00 and log out at 10:50:20, the duration time is 01:50:20
The first day logout time and duration time is also updated. That means that the first day logout time takes the second day logout time (i.e. 10:50:20).
How to do this correctly?
You shouldn't store only time but date and operations type and find previous record on logout.
When it login type record You can calculate difference otherwise abnormal situation.
So on login - if previous record type is login - abnormal.
What You should do in abnormal situation depends on You.
But if you use web technology You must understand what user can never logout.

What does "end of a day" mean for Google Analytics session lifetime?

According to:
http://analytics.blogspot.com/2011/08/update-to-sessions-in-google-analytics.html
the GA session cookie (__utmb cookie) expires when more than 30 minutes passed without any user input, traffic source changed OR at the end of a day.
What does this last condition mean, is it 24h max lifetime since the visit started, is a hard limit set to midnight (if yes, what timezone?)
The "end of day" is midnight according to the settings of the Google Analytics profile.
So, there's a single universal "midnight" for each profile; it doesn't vary by the location or time for the local user.
If you didn't manually alter it to your preferred time zone, the default value is set to GMT -0700 US Pacific.
You can manually change the time zone in your Profile Settings:
Note that changing your time zone is a disruptive activity, since your GA data will be affected for the number of hours you change.
If you change forward in time, you'll end up with "empty" hours on the day of the transition.
If you change back in time, you'll end up with double-filled hours on the day of the transition.

How do I subtract dates?

Let's say that guy register's to my site for 5$ for 30 days. So how do I make code that automaticly after 30 days delete's his account?
Thanks for answers and sorry for poor english
Respectfully, Tom
Use the date handling functions of your preferred programming language. Do not attempt to implement it yourself. It's harder than you think.
I'd suggest simply noting the account's expiration date in its record, rather than having some sort of scheduled process to delete expired accounts.
For a .Net example: when you receive the $5 payment, set the account's expiration date to DateTime.Now.AddDays(30), and reject login on an account where expirationDate < DateTime.Now.
In Java, you'd need to pour the Date into a Calendar in order to add days, then pour it back into a Date when you're done.
However, what facilities are available to handle dates are determined by your environment.
If you can, convert the registration date and the current time to UNIX timestamps. Then subtract their registration time from the current time and check if the result is greater than the number of seconds in 30 days. (60 seconds * 60 minutes * 24 hours * 30 days = 2592000 seconds.)
Most likely you would run a cron job every day or so and check and see if an account's last payment was 30 days ago, and then delete the user. However, manipulating the date is difficult to explain unless we know what language you are using. Since you specified DateTime I'm going to assume that you mean the .NET DateTime object and then you can just do DateTime.addMonths(-1); or DateTime.addDays(-30) respectively.
If you just have to count 30 days you can count them as 30 * 24 * 60 * 60 = 2592000 seconds and simply subtract the unix timestamps.
Anything more complex than this is a PITA to implement yourself and yuo should follow recursive's advice.

Resources