草庐IT

expiration

全部标签

c# - .NET 网络 API : Set a different Refresh Token Expiration time for different users

我正在使用IdentityServer3为我的角度客户端进行身份验证和生成访问/刷新token。我目前正在为我的Angular客户端设置刷新token在48小时后过期。一些使用我的Angular应用程序的用户需要连续登录100天而无需重新输入他们的凭据,是否可以为特定用户而不是整个客户端设置我的刷新token的到期时间?我的数据库中有100个用户,我希望只有一个特定用户不需要在100天内重新进行身份验证,而其余用户应每48小时进行一次身份验证。类似的东西:if(user=="SuperMan"){AbsoluteRefreshTokenLifetime=TimeSpan.FromDay

c# - .NET 4 ObjectCache - 我们可以连接到 "Cache Expired"事件吗?

我有一个像这样缓存的简单对象:_myCache.Add(someKey,someObj,policy);_myCache声明为ObjectCache(但通过DI作为MemoryCache.Default注入(inject)),someObj是我正在添加的对象,policy是一个CacheItemPolicy。如果我有这样的CacheItemPolicy:varpolicy=newCacheItemPolicy{Priority=CacheItemPriority.Default,SlidingExpiration=TimeSpan.FromHours(1)};表示1小时后过期。很酷。但

javascript - 使用 javascript 设置持久性 cookie

我在我的应用程序中发现了一个奇怪的错误,由于我对Javascript的经验不足,我无法调试它;我正在尝试设置一个持久性cookie,该cookie将在其设置(主要浏览器中的最大值)一年后消失,但会持续存在并且在浏览器关闭后不会被删除。我一直在使用这段代码://Buildtheexpirationdatestring:varexpiration_date=newDate();expiration_date.setYear(expiration_date.getYear()+1);expiration_date=expiration_date.toGMTString();//Buildth

php - 对于存储在 DynamoDB 中的 PHP Session,我可以使用具有自动 TTL 功能的 "expires"字段吗

在DynamoDB中存储PHPsession非常酷。https://docs.aws.amazon.com/aws-sdk-php/v2/guide/feature-dynamodb-session-handler.html我在DynamoDB引入新的自动TTL功能之前就开始使用它。在我看来,AWSSDK存储在每个session记录中的“expires”字段对于TTL功能使用的属性来说看起来完美。我试着用这个属性启用TTL并做了一些“将过期的项目的预览”,事情看起来很合理。但在我打开它并打破它之前,我想知道是否还有其他人更熟悉DynamoDB中的PHPsession、对此的SDK支持以

php - 替代 mod_expires 来设置过期 header ?

我在Apache服务器上使用php。我无法在我正在使用的服务器上的.htaccess中设置过期header,因为它是共享服务器,并且它们(网络主机)不会在apache构建中安装mod_expires模块。我一直使用ExpiresActiveOn并为.htaccess中的图像、js、xml和文本文件设置默认缓存过期时间文件。我还有哪些其他选择?谢谢。 最佳答案 您可以使用.htaccess而无需mod_expires。HeadersetExpires"Wed,15Apr202020:00:00GMT"HeadersetCache-Co

php - PHP 中的日期不准确

我有这个代码:$expiration_date='2041-07-14'$epoch_timestamp_expiration_date=strtotime($expiration_date);//Get7days$seven_days_ago=7*86400;//subtractsevendaysfromtheexpirationdate.$epoch_timestamp_expiration_date-=$seven_days_ago;//Formatthenewexpirationdate-7daysago$formatted_epoch_time=date('Y-m-d',$e

php - setcookie with expire=0 在浏览器关闭后不会过期

我使用setcookie制作一个expire=0的cookie。从PHP文档中,(link)Thetimethecookieexpires.ThisisaUnixtimestampsoisinnumberofsecondssincetheepoch.Inotherwords,you'llmostlikelysetthiswiththetime()functionplusthenumber?ofsecondsbeforeyouwantittoexpire.Oryoumightusemktime().time()+60*60*24*30willsetthecookietoexpirein3

php - 使用全新的 Google API 服务器 key 的响应显示为 'The provided API key is expired'

我最近创建了一个Google开发者帐户,附上了用于结算的信用卡信息,启用了PlacesAPI,并创建了一个服务器key并附上了我的服务器IP地址-但是当我尝试在我的代码中访问API时,我得到响应:SimpleXMLElementObject([status]=>REQUEST_DENIED[error_message]=>TheprovidedAPIkeyisexpired.)我用于API访问的端点是:https://maps.googleapis.com/maps/api/place/textsearch/xml?query=$query&type=$type&sensor=true

php - sess_expire_on_close 不工作

我有一个问题..在$config['sess_expire_on_close']=TRUE;当我关闭浏览器时..session仍然保存在数据库中。我仍然可以在user_data列中看到数据。config.php$config['sess_cookie_name']='ci_session';$config['sess_expiration']=2400;$config['sess_expire_on_close']=TRUE;$config['sess_encrypt_cookie']=FALSE;$config['sess_use_database']=TRUE;$config['s

php - 快速提问 : How to set a cookie that will expire after 90days in PHP?

我想使用PHP设置一个90天后过期的cookie,我该怎么做?提前致谢。 最佳答案 setcookie(name,value,time()+60*60*24*90);这会将cookie设置为90天。 关于php-快速提问:Howtosetacookiethatwillexpireafter90daysinPHP?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/4138984/