如何配置Seaside 3.2会话超时(年龄)

时间:2016-12-15 20:53:23

标签: smalltalk pharo seaside

使用Seaside应用程序启动我的图像时,我在启动方法中有这个代码:

<!DOCTYPE html>
<html>
<head>
    <title>Responsive Navigation Demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <style>
body {
    background-color: #191616;
    margin: 0 auto;
    height: 100%;
    text-align: center;
}
nav {
    height: 35px;
    width: 100%;
    /** background: #84A2B2; **/
    font-size: 12pt;
    font-family: 'PT Sans', Arial, sans-serif;
    font-weight: bold;
    border-bottom: 1px solid #FF565D;
}
nav ul {
    padding: 0;
    margin: 0 auto;
    height: 35px;
}
nav li {
    display: inline;
}
nav a {
    color: #FF565D;
    display: inline-block;
    width: 80px;
    text-align: center;
    text-decoration: none;
    line-height: 35px;
}

nav li:last-child a {
    border-right: 0;
}
nav a:hover, nav a:active {
    background-color: #1C1919;
    color: #FB776B;
}
nav a#pull {
    display: none;
}

#thetitle {
    width: 60%;
    min-height: 35px;
    background: #191616;
    border: 0;
    color: #FF565D;
    margin: 0 auto;
    padding: 20px;
    outline: none;
    resize: none;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;;
    font-size: 12pt;
    font-family: 'PT Sans', Arial, sans-serif;
}
#thenotes {
    width: 60%;
    min-height: 750px;
    background: #191616;
    border: 0;
    color: #FF565D;
    margin: 0 auto;
    padding: 20px;
    outline: none;
    resize: none;
    font-size: 12pt;
    font-family: 'PT Sans', Arial, sans-serif;
}
#thenotes::selection {
    background: ;
}

p a {
    font-size: 11pt;
    font-family: 'PT Sans', Arial, sans-serif;
    font-weight: bold;
    color: #FF565D;
    text-decoration: none;
}

    </style>
    <link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

</head>
<body>
    <nav>
        <ul>
            <li><a href="#">FONT</a></li>
            <li><a href="#">COLOR</a></li>
            <li><a href="#">+</a></li>
            <li><a href="#">-</a></li>
            <li><a href="#"><b>B</b></a></li>
            <li><a href="#"><i>I</i></a></li>
            <li><a href="#"><u>U</u></a></li>
        </ul>
    </nav>

    <textarea contenteditable="yes"  id="thetitle" placeholder="Title..."></textarea>
    <textarea contenteditable="yes"  id="thenotes"></textarea>
<p><a class="saver" href="#">SAVE</a></p>

<script>
        var container = document.getElementById('thenotes');
        var containertitle = document.getElementById('thetitle');
        var anchor = document.querySelector(".saver");
        var dt = new Date();
        var time = dt.getFullYear() + ":" + dt.getMonth() + ":" + dt.getDay() + "   " + dt.getHours() + "." + dt.getMinutes() + "." + dt.getSeconds();


        anchor.onclick = function() {
    if ($('#thetitle').val() != '')
    {
        anchor.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(container.value);
        anchor.download = encodeURIComponent(containertitle.value); + '.txt';
    }
    else
    {
        anchor.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(container.value);
        anchor.download = time + '.txt';
    }

};
    </script>
</body>
</html>

这个&#34;最大年龄&#34;会话参数在海边配置网络应用程序中正确显示,但每个海边会话仍然是30分钟。

通过代码动态配置会话超时(年龄)的正确方法是什么?对于Seaside 3.2,请。

1 个答案:

答案 0 :(得分:0)

这有用吗:

anApplication cache expiryPolicy configuration 
at: #cacheTimeout put: 1200

(来自http://book.seaside.st,18.5抓住会话到期通知)