Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

Cookie の取得

Cookie の値を取得するには、保存された Cookie 名で GetCookie メソッドを呼び出すだけです。この値は Set コマンドを使用して、変数 CatID に割り当てられます。

この ObjectScript コードは <script> タグ内に記述し、サーバ側のスクリプトとして認識されます。

—TopPicks.csp—
TopPicks.csp
<html> <body>
<script language="cache" runat="server">
    Set CatID = %request.GetCookie("CacheCinemaLastCategory")
</script>
<h2><font color="#0000FF">Today's Top Picks</font></h2>
<table border=0>
<csp:query 
        name=FilmList 
        classname="Cinema.Film" 
        queryname='#(Query)#' P1="#(CatID)#">
        
<csp:while condition="FilmList.Next()"> ... </csp:while>
</table>
</body> </html>
FeedbackOpens in a new tab