This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已动态机器翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
This content has been machine translated dynamically.
This content has been machine translated dynamically.
This content has been machine translated dynamically.
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.
Este artigo foi traduzido automaticamente.
这篇文章已经过机器翻译.放弃
Translation failed!
用例:限制会话数量
在此用例中,要求限制活动后端会话的数量。在部署中,每个会话登录都在 URL 中登录,每个会话注销都在 URL 中注销。成功登录后,后端会设置一个具有唯一 10 个字符值的会话 ID cookie。
要实现此用例,请执行以下操作:
-
创建可存储每个活动会话的映射变量。映射的关键是会话 ID。变量的过期时间设置为 600 秒(10 分钟)。</span>
> add ns variable session_map -type map(text(10),ulong,100) -expires 600
-
为映射变量创建以下分配:</span>
-
为会话 ID 创建一个条目,并将该值设置为 1(实际上未使用此值)。</span>
> add ns assignment add_session -variable '$session_map[http.req.cookie.value("sessionid")]' -set 1
-
取消分配会话 ID 的条目,该条目隐式地减少了 session_map 的值计数。</span>
> add ns assignment delete_session -variable '$session_map[http.req.cookie.value("sessionid")]' -clear
-
-
为以下内容创建响应程序策略:</span>
-
检查 HTTP 请求中是否存在该会话 ID 的映射条目。如果映射条目不存在,则执行 add_session 分配。</span>
> add responder policy add_session_pol 'http.req.url.contains("twbkwbis.P_SabanciLogin") || $session_map.valueExists(http.req.cookie.value("netsuis"))' add_session
注意: add_session_pol 策略中的 ValueAction () 函数计为对会话映射条目的引用,因此每个请求都会重置其会话的过期超时。如果 10 分钟后没有收到会话请求,则会话的条目将被解除分配。
-
检查会话何时注销。执行删除会话分配。</span>
add responder policy delete_session_pol "http.req.url.contains("Logout")" delete_session
-
检查登录请求以及活动会话数量是否超过 100。如果满足这些条件,为了限制会话数量,用户将被重定向到指示服务器处于忙状态的页面。</span>
add responder action redirect_too_busy redirect "/too_busy.html" add responder policy check_login_pol "http.req.url.contains("twbkwbis.P_SabanciLogin") && $session_map.valueCount > 100" redirect_too_busy
-
-
全局绑定响应程序策略。</span>
bind responder global add_session_pol 30 next bind responder global delete_session_pol 10 bind responder global check_login_pol 20
分享:
分享:
本文中包含的内容
This Preview product documentation is Citrix Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Citrix Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Citrix product purchase decisions.
If you do not agree, select Do Not Agree to exit.