标签: session-timeout

HAProxy,“超时隧道”与“超时客户端/服务器”

配置 HAProxy 时,单独设置“超时隧道”与同时设置“超时客户端”和“超时服务器”(全部设置为相同值)有什么区别?

haproxy session-timeout

5
推荐指数
1
解决办法
9382
查看次数

Spring Cloud Gateway 和 Keycloak 出现中间authorization_request_not_found错误

我正在开发一个在 Spring boot 中开发的微服务架构,并使用 Spring Cloud Gateway 提供 API 网关服务。我使用 Keycloak 作为身份提供者。一切正常,但我在用户登录时遇到中间的authorization_request_not_found异常,并且出现可白标的错误页面。如果我们再试一次,它就会起作用。

以下是我在 Keycloak 服务器上收到的异常:

[org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider] (default task-264) Failed to make identity provider oauth callback: org.keycloak.broker.provider.IdentityBrokerException: No access_token from server.
    at org.keycloak.keycloak-services@9.0.3//org.keycloak.broker.oidc.OIDCIdentityProvider.verifyAccessToken(OIDCIdentityProvider.java:495)
    at org.keycloak.keycloak-services@9.0.3//org.keycloak.broker.oidc.OIDCIdentityProvider.getFederatedIdentity(OIDCIdentityProvider.java:360)
    at org.keycloak.keycloak-services@9.0.3//org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider$Endpoint.authResponse(AbstractOAuth2IdentityProvider.java:472)
    at jdk.internal.reflect.GeneratedMethodAccessor938.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.jboss.resteasy.resteasy-jaxrs@3.9.1.Final//org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:138)
    at org.jboss.resteasy.resteasy-jaxrs@3.9.1.Final//org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:517)
    at org.jboss.resteasy.resteasy-jaxrs@3.9.1.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:406)
    at org.jboss.resteasy.resteasy-jaxrs@3.9.1.Final//org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:370)
    at org.jboss.resteasy.resteasy-jaxrs@3.9.1.Final//org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:356)
    at org.jboss.resteasy.resteasy-jaxrs@3.9.1.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:372)
    at org.jboss.resteasy.resteasy-jaxrs@3.9.1.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:344)
    ... more stack trace
Run Code Online (Sandbox Code Playgroud)

下面是配置代码:

spring:
  mvc:
    favicon:
      enabled: false
  autoconfigure:
    exclude: org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration
  thymeleaf:
    cache: false
  security:
    oauth2:
      resourceserver:
        jwt: …
Run Code Online (Sandbox Code Playgroud)

session-timeout session-cookies spring-security-oauth2 keycloak spring-cloud-gateway

5
推荐指数
0
解决办法
2785
查看次数

处理 URLSession 超时

我使用 URLSession 进行 POST 请求并获取玩家列表,但有时我会获取错误“Error Domain=NSURLErrorDomain Code=-1001”,我该如何处理?

我如何在“完成”中出现错误?

func addPlayer(playerCode: String, completion: @escaping (Error?) -> ()) {
    guard let url = URL(string: "\(url)") else { return }
    
    var urlRequest = URLRequest(url: url)
    urlRequest.httpMethod = "POST"
    
    let playerCode = [playerCode]
    
    let params = ["players": playerCode]
    do {
        let data = try JSONSerialization.data(withJSONObject: params, options: .init())
        
        urlRequest.httpBody = data
        urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
        
        let sessionConfig = URLSessionConfiguration.default
        sessionConfig.timeoutIntervalForRequest = 5.0
        
        DispatchQueue.global(qos: .background).async {
        URLSession(configuration: sessionConfig).dataTask(with: urlRequest) { (data, resp, err) in
    
            guard let …
Run Code Online (Sandbox Code Playgroud)

timeout session-timeout swift urlsession

5
推荐指数
1
解决办法
3376
查看次数

IIS 7中的会话超时

我喜欢在IIS 7.0(Windows Server 2008)中托管asp.net Web应用程序.

我将会话状态配置为sessionstate mode ="inproc"timeout = 120.即使会话在15秒内到期.可能是什么问题呢?.

谢谢

asp.net iis-7 session-timeout

4
推荐指数
3
解决办法
5万
查看次数

由于不活动而如何注销用户

纯服务器端PHP。每次用户提交表单时,我都会更新数据库中的“上次活动”时间。

我想进行定期检查,并强制注销不活动的用户释放许可证。

我该怎么做?我是否还应该将会话ID存储在数据库中,然后销毁该会话?这样可以为另一个用户释放许可证,并且当第一个最终提交另一个表单时,我可以在每个表单操作文件的顶部检查会话是否仍然存在,并在必要时将用户重定向到登录页面。

那行得通吗?这是“最佳”方式吗?任何示例代码?


更新:我正在轮询,因为我需要知道用户何时超时才能更新数据库。

php session session-timeout

4
推荐指数
1
解决办法
1万
查看次数

什么可以导致IIS应用程序重置?

我正在使用healthMonitoring部分监控我的网站.我看到一条消息......

Event code: 1002 
Event message: Application is shutting down. Reason: Hosting environment is shutting down. 
Event time: 8/8/2011 3:29:59 PM 
Event time (UTC): 8/8/2011 8:29:59 PM 
Event ID: 6879adf29cdc403ba8ad2e5694b6cee0 
Event sequence: 730 
Event occurrence: 1 
Event detail code: 50002 
Run Code Online (Sandbox Code Playgroud)

我无法确定它为什么会被关闭.我的应用程序池设置为每24小时重置一次.我的web.config会话设置为在4小时后过期(这不应该影响应用程序关闭).我看到一些帖子提到healthMonitoring设置可以重置一个应用程序,但我没有看到任何特定的设置会这样做.另外,在添加healthMonitoring部分之前,我注意到了这个问题.

仅供参考,以下是它的读取方式......

    <healthMonitoring>
        <bufferModes>
            <add name="Critical Notification" maxBufferSize="100" maxFlushSize="20"
                    urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00"
                    maxBufferThreads="1" />
            <add name="Notification" maxBufferSize="300" maxFlushSize="20"
                    urgentFlushThreshold="1" regularFlushInterval="Infinite" urgentFlushInterval="00:01:00"
                    maxBufferThreads="1" />
            <add name="Analysis" maxBufferSize="1000" maxFlushSize="100"
                    urgentFlushThreshold="100" regularFlushInterval="00:05:00"
                    urgentFlushInterval="00:01:00" maxBufferThreads="1" />
            <add name="Logging" maxBufferSize="1000" maxFlushSize="200" urgentFlushThreshold="800"
                    regularFlushInterval="00:30:00" urgentFlushInterval="00:05:00"
                    maxBufferThreads="1" …
Run Code Online (Sandbox Code Playgroud)

iis session web-applications session-timeout

4
推荐指数
1
解决办法
5003
查看次数

设置最长会话时间是否有任何缺点或限制?

在asp.net中,默认会话超时为20分钟.假设我将会话超时时间更改为2小时或更长时间,那么它是否会导致服务器端出现任何性能问题?

我想知道在asp.net中使用最长会话时间有任何限制或缺点吗?

请指导我摆脱这个问题?

c# asp.net session session-state session-timeout

4
推荐指数
1
解决办法
4228
查看次数

PHP:会话永不过期

昨晚我登录,第二天早上我仍然登录,即使我退出浏览器.我希望会话在几个小时后过期,我认为它可以用"session.gc_maxlifetime"设置为"1440","session.cache_expire"设置为"180"

这是我从PHP.ini中可以找到的内容

Session Support                 enabled
Registered save handlers        files user
Registered serializer handlers  php php_binary wddx


session.auto_start        Off
session.bug_compat_42     Off
session.bug_compat_warn   Off
session.cache_expire      180
session.cache_limiter     nocache
session.cookie_domain     no value
session.cookie_httponly   Off
session.cookie_lifetime   0
session.cookie_path       /
session.cookie_secure     Off
session.entropy_file      no value
session.entropy_length    0
session.gc_divisor        1000
session.gc_maxlifetime    1440
session.gc_probability    0
session.hash_bits_per_character  5
session.hash_function     0
session.name              PHPSESSID
session.referer_check     no value
session.save_handler      files
session.save_path         /var/lib/php5
session.serialize_handler php
session.use_cookies       On
session.use_only_cookies  On
session.use_trans_sid     0
Run Code Online (Sandbox Code Playgroud)

在我们的旧服务器上,我们使用相同的设置和会话.与旧版本的唯一区别是在旧服务器上设置为"memcache"的"session.save_handler"."session.save_path"也不同.

php apache ubuntu session session-timeout

4
推荐指数
1
解决办法
6240
查看次数

如何用putty维护Session?

我发现当我使用putty进行UNIX服务器连接时,它会在一段时间后得到超时消息.每当我打开已经连接的putty窗口时,它已经闲置了30分钟,它会超时,我必须再次登录到新的putty会话.

unix putty session-timeout

4
推荐指数
1
解决办法
6401
查看次数

Ruby on Rails设计不活动后的Timeoutable重定向

我正在使用Devise的Timeoutable功能,我有点困惑.如果用户的会话超时,则在刷新页面或执行涉及Rails控制器的操作(例如,导航到站点内的其他页面)时,会将其重定向到登录页面.但是,由于我网站上的用户敏感信息,我想在超时发生后立即自动将用户发送到登录屏幕.有这样做的标准方法吗?

这是我的参考代码:https://stackoverflow.com/a/35464748/4714425

ruby-on-rails session-timeout devise

4
推荐指数
1
解决办法
3184
查看次数