diff --recursive -du twiki.orig/lib/TWiki/Client/TemplateLogin.pm twiki.remember/lib/TWiki/Client/TemplateLogin.pm
--- twiki.orig/lib/TWiki/Client/TemplateLogin.pm	2006-12-05 15:36:13.000000000 -0800
+++ twiki.remember/lib/TWiki/Client/TemplateLogin.pm	2006-12-05 15:38:41.000000000 -0800
@@ -99,6 +99,7 @@
     my $origurl = $query->param( 'origurl' );
     my $loginName = $query->param( 'username' );
     my $loginPass = $query->param( 'password' );
+    my $remember = $query->param( 'remember' );
 
     my $tmpl = $twiki->{templates}->readTemplate(
         'login', $twiki->getSkin() );
@@ -108,8 +109,9 @@
     my $topic = $twiki->{topicName};
     my $web = $twiki->{webName};
 
-    my $cgisession = $this->{cgisession};
+    my $cgisession = $this->{_cgisession};
 
+    $cgisession->param( 'REMEMBER', $remember ) if $cgisession;
     if( $cgisession && $cgisession->param( 'AUTHUSER' ) &&
           $loginName ne $cgisession->param( 'AUTHUSER' )) {
         $banner = $twiki->{templates}->expandTemplate( 'LOGGED_IN_BANNER' );
diff --recursive -du twiki.orig/lib/TWiki/Client.pm twiki.remember/lib/TWiki/Client.pm
--- twiki.orig/lib/TWiki/Client.pm	2006-12-05 15:35:51.000000000 -0800
+++ twiki.remember/lib/TWiki/Client.pm	2006-12-05 15:38:26.000000000 -0800
@@ -341,6 +341,7 @@
 	my $time = time() || 0;
     my $exp = $TWiki::cfg{Sessions}{ExpireAfter} || 36000; # 10 hours
     $exp = -$exp if $exp < 0;
+        my $rememberexp = 31622400; # 1 year
 
 	opendir(D, $TWiki::cfg{Sessions}{Dir}) || return;
 	foreach my $file ( grep { /cgisess_[0-9a-f]{32}/ } readdir(D) ) {
@@ -367,7 +368,9 @@
 		next if ( $@ );
         # The session is expired if it is empty, hasn't been accessed in ages
         # or has exceeded its registered expiry time.
-        if( !$D || $time >= $D->{_SESSION_ATIME} + $exp ||
+        if( !$D ||
+              !$D->{REMEMBER} && $time >= $D->{_SESSION_ATIME} + $exp ||
+              $time >= $D->{_SESSION_ATIME} + $rememberexp ||
               $D->{_SESSION_ETIME} && $time >= $D->{_SESSION_ETIME} ) {
             unlink( $file );
             next;
@@ -573,9 +576,12 @@
     return if $TWiki::cfg{Sessions}{MapIP2SID};
 
     my $query = $this->{twiki}->{cgiQuery};
+    my $expires = $this->getSessionValue( 'REMEMBER' ) ? '+1y' : undef();
+
     my $c = CGI::Cookie->new( -name => $CGI::Session::NAME,
                               -value => $this->{_cgisession}->id(),
-                              -path => '/' );
+                              -path => '/',
+                              -expires => $expires );
 
     push( @{$this->{_cookies}}, $c );
     $hopts->{cookie} = $this->{_cookies};
@@ -608,9 +614,11 @@
         #
         # So this is just a big fat precaution, just like the rest of this
         # whole handler.
+        my $expires = $this->getSessionValue( 'REMEMBER' ) ? '+1y' : undef();
         my $cookie = CGI::Cookie->new( -name => $CGI::Session::NAME,
                                        -value => $this->{_cgisession}->id(),
-                                       -path => '/' );
+                                       -path => '/',
+                                       -expires => $expires );
         push( @{$this->{_cookies}}, $cookie );
     }
 
diff --recursive -du twiki.orig/templates/login.pattern.tmpl twiki.remember/templates/login.pattern.tmpl
--- twiki.orig/templates/login.pattern.tmpl	2006-12-05 15:37:13.000000000 -0800
+++ twiki.remember/templates/login.pattern.tmpl	2006-12-05 15:37:46.000000000 -0800
@@ -71,6 +71,10 @@
 
 
 
+%TMPL:DEF{"remembernote"}%&nbsp;<span class="twikiSmallish twikiGrayText">Remember me</span>%TMPL:END%
+
+
+
 %TMPL:DEF{"seealsonote"}%<div class="twikiSmallish twikiGrayText">
 %MAKETEXT{"See also:"}% %TWIKIWEB%.TWikiRegistration, %TWIKIWEB%.ResetPassword, %TWIKIWEB%.ChangePassword <br />
 %MAKETEXT{"If you have any questions, please contact [_1]." args="%WIKIWEBMASTER%"}%
@@ -95,8 +99,11 @@
 
 %ICON{"key"}% <input class="patternFormFieldVerticalForm" type="password" size="30" name="password" value="" tabindex="2" /><input type="hidden" name="origurl" value="%ORIGURL%" />%TMPL:P{"forgotpasswordnote"}%
 </div><!-- /twikiFormStep-->
+<div class="twikiFormStep">
+%ICON{"watch"}% <label><input id="remember" class="twikiInputField" type="checkbox" name="remember" value="1" tabindex="3" />%TMPL:P{"remembernote"}%</label>
+</div><!-- /twikiFormStep-->
 <div class="twikiFormStep twikiLast">
-<input class="twikiSubmit" type="submit" value='%MAKETEXT{"Logon"}%' tabindex="3" />
+<input class="twikiSubmit" type="submit" value='%MAKETEXT{"Logon"}%' tabindex="4" />
 </div><!-- /twikiFormStep-->
 </div><!-- /twikiFormSteps-->
 </form>
