Instead of deleteing REMOTE_USER, set a logout url in your development.ini:
authkit.cookie.signout = /myapp/logout
for the action something like:
def logout(self):
if request.environ.has_key('REMOTE_USER'):
return redirect_to(controller = '/myapp/logout')
else:
return redirect_to(controller = '/myapp/login')
and for the template just to round things out:
<a href="/myapp/logout">logout</a>
This will remove the REMOTE_USER via the authkit 'way' or at least my
interpretation of it from the manual.
On 6/13/07, Michael G. Noll <[EMAIL PROTECTED]> wrote:
>
>
>
> On Jun 13, 9:28 pm, voltron <[EMAIL PROTECTED]> wrote:
> > Since both of you have AuthKit working, how does one set a session for
> > an authenticated user? How do you set the REMOTE_USER? I thought of
> > creating a session variable like "isauthenticated = True" but it has
> > to be set after REMOTE_USER is set, which i my case, is a headache
> >
> > request.environ['paste.auth_tkt.set_user'](username)
> >
> > Does not work for me in my controllers
>
> Which version of AuthKit are you using? I am running Pylons 0.9.5 and
> AuthKit 0.3.0pre5, and
>
> request.environ['paste.auth_tkt.set_user'](username)
>
> works without any problems for my signin() method.
>
> However, I had to manually remove REMOTE_USER in my user controller's
> signout() method because even though I called
>
> request.environ['paste.auth_tkt.logout_user']()
>
> the REMOTE_USER variable was still set/available in my Mako templates
> when the response was rendered to show a "You have been signed out"
> message. When refreshing/re-GETting the web page, REMOTE_USER was
> gone.
>
> (in other words: the user was actually logged out, but the template
> called by the controller's return statement still had access to the
> REMOTE_USER variable)
>
> I fixed this with
>
> request.environ['paste.auth_tkt.logout_user']()
> del request.environ['REMOTE_USER']
>
> Michael
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---