[Zope] Logout User

Casey Duncan casey@zope.com
Thu, 5 Sep 2002 11:38:47 -0400


It raises the 'Unauthorized' exception. This does not work with all brows=
ers=20
(IE in particular) and is not very user friendly because it pops up the=20
authentication window, which must be cancelled in order to actually log o=
ut.

You can however do it if you like. Calling it log out is a bit of a stret=
ch=20
IMHO.

In a python script:

raise 'Unauthorized'

-Casey

On Thursday 05 September 2002 11:32 am, Borislav wrote:
> > The default is basic auth, which has no intrinsic notion of logging o=
ut.=20
If=20
> > you install the CookieCrumbler product, that will let you use cookie =
auth=20
and=20
> > you will be able to log out users by expiring their cookies.
> >=20
>=20
> How is then Zope able to log me out of its management interface? I=20
> checked the frame source where the logout menu is:
>=20
> <form action=3D"/" method=3D"POST" target=3D"manage_main">
> <span class=3D"std-text">Logged in as <strong>admin</strong></span>=20
> <select class=3D"form-element" name=3D":action"=20
>=20
onChange=3D"window.parent.manage_main.location.href=3D'/'+this.options[th=
is.selectedIndex].value">
> <option value=3D"zope_quick_start">Zope Quick Start</option>
> <option value=3D"manage_zmi_prefs">Set Preferences</option>
> <option value=3D"manage_zmi_logout">Logout</option>
> </select>
> <input class=3D"form-element" type=3D"submit" name=3D"submit" value=3D"=
 Go " />
>=20
> Is there a way to use the same facility from my scripts? It seems to me=
=20
> that logging out a user is a basic operation that should be supported b=
y=20
> Zope 'out of the box', without the need of additional products. Just=20
> wondering...
>=20
> --Borislav
>=20
>=20