As far as I can tell the issue with using Static pages and detecting when a user has logged in was never answered, aside from use the Dynamic build :-P
If your exporting your Static pages as PHP (Setup > Build Options > build_extension: .php) its a very straightforward fix to set it up so when users login they don't need to login again for 31 days (or what ever time you specify) and also once they're logged in they can have access to the members only features on your site with the static pages like showing the correct Login or Logout link.
In FileMan (Build > FileMan) do a search for the Authenticate.pm file and do a search for this line of code (help to use IE for this as you can do a Ctrl+F search within the browser window):
my $session_cookie = $IN->cookie ( -name => 's', -value => $session_id, -path => '/' );
and replace with:
my $session_cookie = $IN->cookie ( -name => 's', -value => $session_id, -path => '/', -expires => '+31d' );
and Save - the extra code sets the login cookie 's' to expire in 31 days.
Then add the PHP code to detect the cookie on any of your static pages eg. home.html
Code:
<?php // Checks if the 's' cookie is empty on the browser
if (empty($HTTP_COOKIE_VARS["s"])) {
echo "<a href='http://www.yourdomain.com/cgi-bin/user.cgi'>Login</a>";
} else {
echo "<a href='http://www.yourdomain.com/cgi-bin/user.cgi?logout=1'>Logout</a>";
}
?>
<?php
if (!empty($HTTP_COOKIE_VARS["s"])) {
// Display members only feature here
}
?>
for your dynamic pages (search.cgi etc.) you can use the original LinkSQL code eg.
<%if Username%>
<a href="<%db_cgi_url%>/user.cgi?logout=1">Logout</a>
<%endif%>
<%ifnot Username%>
<a href="<%db_cgi_url%>/user.cgi">Login</a>
<%endif%>
Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile