Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Sessions & logout.htm

Quote Reply
Sessions & logout.htm
hi,

I want to return my users to a duplicate of the login page when they log out of the webmail service, but I'm having some problems with the display of the cookies menu in the login_include.htm file.

When I go straight to the login page it displays fine. But if I log out of the system it displays an empty space. The problem has something to do with the user's current session ending... any idea anyone?


<%if sessions_cookies == 2%>
<select name=cookie>
<option selected>Yes</option>
<option>No</option>
</select>
<%else%>&nbsp;<%endif%>


regan.
Quote Reply
Re: [ryel01] Sessions & logout.htm In reply to
actually, returning the user to the login page with a "successfull logout" message might be a better way for the system to handle logouts - instead of having a seperate logout.htm page?

maybe this could happen in the next release?

regan.
Quote Reply
Re: [ryel01] Sessions & logout.htm In reply to
It's because logout and login use different methods to print page. login uses the NoAuth print_page, and logout uses the print_page from GMail. The NoAuth print_page, adds those extra variables (such as sessions_cookies) and GMail doesn't. That's why it doesn't work. There are two ways to get around this:
1) Change logout.htm, to do a redirect to login.htm with message=Your+message+goes+here.
eg:
Code:
<META HTTP-EQUIV="refresh" CONTENT="0;URL=http://domain.com/cgi-bin/user/login.cgi?t=<%t%>;message=You+have+been+successfully+logged+out.">

2) Change logout.cgi, to add the variables that NoAuth's print_page adds (just before it calls print_page):
Code:
use GMail::NoAuth;
my @tags = GMail::NoAuth->get_tags();
push @tags, { message => $CFG->{language}->{LOGOUT_SUCCESS} };
# Print the logout page
GMail->print_page($CFG->{templates}->{logout}, @tags);
You would also add the LOGOUT_SUCCESS language variable. You would now have these variables available on the logout page. I'll talk to Alex to see if he thinks this is worth changing in the current code.

You can change it to not use the logout.htm page as well but changing your ConfigData.pm (back it up before modifying it!). You should see a key 'templates', and in that hash, 'logout'. Currently its value is 'logout.htm'. If you change that value to 'login.htm', then they'll be sent to the login.htm page on logout. Combine this with the added tags we did in 2), and you'll acheive what you wanted.

Adrian
Quote Reply
Re: [brewt] Sessions & logout.htm In reply to
I've gone with option 2 and it works perfectly! Now I've got 1 less template to worry about! Smile - definately an improvement.

I can't see why this also couldn't happen instead of having the error_auth.htm and error_user.htm templates? Just return the user to the login page and display the error message there?

What do you think?

thanks again adrian.

regan.

Last edited by:

ryel01: May 28, 2002, 3:10 PM
Quote Reply
Re: [brewt] Sessions & logout.htm In reply to
the same thing could happen with the password reminder function if the admin has it set to "email password" - just return the user to the login page and display the "your password has been emailed to you" message. that would cut down on another login page template being doubled up.

r.
Quote Reply
Re: [ryel01] Sessions & logout.htm In reply to
I personally agree!

Just because I like to keep it simple. But I can imagine that others would like to have a lot of different templates to be able to create a true unique website. So...............