create new tag
, view all tags

Feature Proposal: TemplateLogin option to "keep me logged in"


I find it annoying to log to my intranet TWiki every time I start my browser. I suspect that the typical office user would find it even more annoying.

Description and Documentation

Add an option to the login form to "Keep me logged in", that sets the cookie expiration to a month (or some other suitable time) in the future.


Impact and Available Solutions


-- Contributors: BryceSchober


-- BryceSchober - 12 Oct 2006

Thanks for your proposal. If some developer supports this and want a decision made for the change, please add a link to this topic from WhatIsIn04x01. The 14 day "auto-accept" period will not begin unless there is a driver willing to implement it.

-- KennethLavrsen - 12 Oct 2006

If I had the time and knew how to code this I would do it in a heartbeat. That is a great feature proposal.

-- JoshuaJohnston - 13 Oct 2006

I recently described how to do this in a Support topic. It's a minor two-line hack, though to code it fully requires (yet another) configuration option.

-- CrawfordCurrie - 14 Oct 2006

I implemented this in about 22 lines, mainly following CrawfordCurrie's suggestion. I attached my code as http://www.twiki.org/p/pub/Codev/RememberCookieLogin/remember.diff. The attachment is limited in that sessions are remembered for one year instead of being configurable, and there is no localization.

-- ChadParry - 05 Dec 2006

Chad, many thanks for this contribution. I looked briefly at your patch, but it doesn't seem to contain any documentation updates. Did you forget include them in the patch?

Also, I am slightly concerned that if remember isn't selected, then -expires in the cookie is set to undef, which is different to not being set. Did you check to make sure that the session is indeed forgotten if remember is not clicked?

Please follow up in Bugs:Item3250

-- CrawfordCurrie - 06 Dec 2006

I have made a patch for a small layout change to the login template, that has the remember me checkbox close to the passworde field, like this:


Apply patch to the current login.pattern.tmpl.

It would be even better if the checkbox label could tell us how many months it will remember me.

-- ArthurClemens - 06 Dec 2006

Ah, my first TWiki bug. smile Passing undef for the "expires" parameter behaved OK. I couldn't find any documentation to support my assumption that it should work though. To be safe, I updated the patch. It makes the change slightly easier to read, anyway.

-- ChadParry - 06 Dec 2006

CrawfordCurrie asks a good question about documentation. This patch only contains the minimum change that could get this feature to work on my system. It doesn't yet deal with documentation or localization. I didn't want to do that extra work up front in the case that the feature got rejected by the team anyway.

I'll add the documentation sometime during the next week and upload a new patch.

It was mentioned that I should follow up in Bugs:Item3250. I don't know how TWiki bug tracking works yet, so I guess I'll just cross-post this info to both this topic and that bug. Please let me know where the right place is for this discussion.

-- ChadParry - 06 Dec 2006

Hmm, the Bugs:Item3250 topic isn't a regular topic, is it? It looks like it was generated from a source repository. Well, I won't add anything to that page for now because I don't know how.

-- ChadParry - 06 Dec 2006

No it isn't generated from source. Just use the user/password pair you use to post at twiki.org (as told in the yellow box at the top wink ), they should be synchronized.

-- FranzJosefSilli - 06 Dec 2006

My password doesn't work on develop.twiki.org. I guess I won't worry about it for now.

-- ChadParry - 07 Dec 2006

I just triggered Sven to do a manual sync between twiki.org and develop.twiki.org so try again please.

-- KennethLavrsen - 07 Dec 2006

As I also added to the bug item, I would like to be able to use this feature also in Apache Login mode. There you do not have anything else than the browser pop up that asks you to authenticate. You cannot click a "Remember Me" checkbox. I would like to make this feature possible also for my TWiki which is plain Apache LDAP authenticated so I would like to somehow be able to enable this feature. Another problem is that with this feature how will I log out in Apache authenticated TWikis. In a meeting room with a meeting room computer this is important.

-- KennethLavrsen - 09 Dec 2006

Since login/logout in ApacheLogin is under the control of the browser and not TWiki, you can't do this. Most browsers have a password memory option that will remember passwords.

-- CrawfordCurrie - 10 Dec 2006

I've updated the patch based on these suggestions. The new patch uses the formatting suggested by ArthurClemens. Additionally, I made these changes:

I fixed a typo:

%{ TMPL:P{"rememberbox" }%
should be


<input class="twikiSubmit" type="submit" value='%MAKETEXT{"Logon"}%' 

tabindex="3" />
should be:
<input class="twikiSubmit" type="submit" value='%MAKETEXT{"Logon"}%' 

tabindex="4" />

The duration that the cookie will last is now a constant in Client.pm

I added documentation to the functions that I modified.

-- ChadParry - 31 Dec 2006

My 400 users are desperate for this fix, but I'm not exactly sure what I'm supposed to do with the .patch and .diff files attached. Could someone clarify it for me?

-- KirkMartinez - 26 Mar 2007

Kirk. This is the kind of change that does not go into Patch releases.

As far as I can see the feature has been implemented in the MAIN branch of the TWiki SVN and you can try it from there. However I would not use current MAIN branch for production. A lot is going on at the moment in MAIN with major code refactorings meant to speed up TWiki. The next release 4.2 is not in a very near future so I guess you have to be patient. We do not even have a predicted release date for 4.2.0 yet. Expect it to be many months from now.

-- KennethLavrsen - 07 Apr 2007

For references.

The 14 day rule originally did not apply to this because at first there was no driver. However the discussion continued and Chad and Crawford took it up and got it driven to an accepted spec and implementation.

There were no open concerns left so this was accepted by consensus.

In future we wil get a status in the form for the proposal twiki app so people can flag to the customer advocates that consensus is reached.

-- KennethLavrsen - 09 Apr 2007

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng login.png r1 manage 48.1 K 2006-12-06 - 10:36 ArthurClemens Layout change result
Unknown file formatpatch login_template.patch r1 manage 2.1 K 2006-12-06 - 10:35 ArthurClemens Small layout change to login template patch
Unknown file formatdiff remember.diff r4 r3 r2 r1 manage 9.2 K 2007-01-15 - 02:00 ChadParry Recommended fix
Edit | Attach | Watch | Print version | History: r20 < r19 < r18 < r17 < r16 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r20 - 2007-04-25 - KennethLavrsen
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.