计算机中设置用户过期日期,订阅到期日期,如果用户更改日期(Subscription Expiry Date if user changes dates)...

订阅到期日期,如果用户更改日期(Subscription Expiry Date if user changes dates)

我们的应用程序使用不可更新订阅来提供对内容的访问,为期一年。 订阅收据存储在iCloud(如果可用)和设备钥匙串中。 有时会调用WS来验证收据但不记录交易。

我们的问题是如果用户向后更改时钟(比如将日期设置为2010),我们的订阅不会在一年后过期,而是在三年后(2013-2010)过期。

我们的解决方案是说,持续时间超过一年的订阅是欺诈性的,并且收据被清除并且生命继续。

但是,我的老板现在抱怨用户将时钟设置为过去六个月(不到一年就可以,但订阅持续1。5年而不是有效的一年)。

有没有更好的方法来处理设备时钟篡改或者是我们必须忍受的东西(我相信)?

Our app uses Non-Renewable Subscriptions to provide access to content for one year. The subscription receipt is stored on iCloud (when available) and in the device keychain. There is also a WS that is called on occasion to validate the receipt but does not record the transaction.

Our problem is if the users change their clock backwards (say set the date to 2010), our subscription does not expire after one year but now three years (2013-2010).

Our solution was to say that subscriptions with a duration of more than one year are fraudulent and the receipt is cleared and life goes on.

However, my boss now is complaining about users that set the clock to six months in the past (less than one year so ok, but the subscription lasts for 1.5 years instead of the valid one year).

Is there a better way to be dealing with device clock tampering or is it something we have to live with (as I believe)?

原文:https://stackoverflow.com/questions/15025747

更新时间:2019-06-26 14:49

最满意答案

正如我在上面的评论中所说,我会使用受信任的服务器检查时间,而不是使用本地时间。 同样重要的是,一旦收据到期,立即将其删除或将其标记为已过期,以便他们无法关闭网络访问并回滚时间以便使用它。

As I said in my comment above, I would check the time with a trusted server instead of using the local time. Just as important, once a receipt expires, immediately delete it or mark it as expired so that they can't turn off network access and roll back the time in order to use it.

相关问答

下面跟踪数组中的内容,而不是尝试滥用字符串作为迭代。 #!/usr/bin/env bash

# return all addresses that smell like HTTP

get_addrs() {

netstat -plant \

| awk '/LISTEN/ && /http/ && ! ($4 ~ /:(80|5555)$/) { print $4; }' \

| sort -u

}

# Given a local server address, return a

...

正如我在上面的评论中所说,我会使用受信任的服务器检查时间,而不是使用本地时间。 同样重要的是,一旦收据到期,立即将其删除或将其标记为已过期,以便他们无法关闭网络访问并回滚时间以便使用它。 As I said in my comment above, I would check the time with a trusted server instead of using the local time. Just as important, once a receipt expires, immed

...

我正在使用moment.js库进行日期时间操作 。 添加12个月的示例代码: $(function () {

$("#tabs").tabs();

$("#").datepicker();

$("body").on("change","#",function(){

var selected = $(this).val();

var endD

...

可以在您的应用安装文件夹中保留一个虚拟.dll文件,打开它并保留天数和安装日期时间。 每次应用程序加载时,请检查它。 .Dll文件人们不会尝试打开和阅读。 也许你可以加密并存储在里面。 这可能非常简单。 May be keep a dummy .dll file in your app install folder, open it and keep the number of days and install date time. Every time application loads up,

...

你需要转换为时间,日期只是一个字符串... $now = strtotime(date("Y-m-d"));

if (strtotime($user_id['enddate']) < $now) {

?>

your Licence is out of date

}

else

{

?>

your licence is in date

}

You need to convert to time, date is

...

您可以在不更新其到期日期的情况下更新cookie值的唯一方法是将有效期自身添加到值中; 那是因为浏览器只向您发送cookie的名称和值。 if (isset($_COOKIE['count'])) {

list($exp, $val) = explode('|', $_COOKIE['count'], 2);

++$val;

} else {

$exp = time() + 86400;

$val = 1;

}

setcookie('count', "$exp|$v

...

您正在沙盒模式下进行测试,而不是在生产模式下进行测试 在这种情况下,订阅时间要短得多:7天订阅只需5分钟,1年订阅会在一小时后到期。 You are testing in sandbox mode and not in production mode. In this case subscriptions are much shorter: 7-day subscriptions are only 5 minutes and 1-year subscriptions expire after an

...

设置cookie后,您无法读取过期日期。 您只能获得key = value对。 如果您需要日期,则需要将其设置为cookie本身的数据的一部分。 您可以在数组中设置多个数据片段并将其序列化并将其存储在cookie中。 然后,当您阅读它时,您将反序列化它。 You cannot read the expiration date back once the cookie has been set. You can only get the key=value pairs. If you need th

...

对于信用卡到期验证,您可以这样做。 var today, someday;

var exMonth=document.getElementById("exMonth");

var exYear=document.getElementById("exYear");

today = new Date();

someday = new Date();

someday.setFullYear(exYear, exMonth, 1);

if (someday < today) {

alert("Th

...

您不能使用'chage',因为它需要指定日期。 如果您想在几分钟后停用用户,请使用以下命令 adduser username_here && sleep 600 && usermod --lock username_here

要么 adduser username_here

echo usermod --lock username_here | at now + 10 minutes

You cannot use the 'chage' since it require specifying

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值