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
-~----------~----~----~----~------~----~------~--~---

Reply via email to