[Zope] Re: CookieCrumbler: Login a user without a "login_form" Template

Jens Vagelpohl jens at zope.com
Sun Oct 12 15:29:30 EDT 2003


On Sunday, Oct 12, 2003, at 15:25 US/Eastern, Nico Grubert wrote:
>  def loginUser(self, REQUEST=None, RESPONSE=None):
>      "login a user into Zope"
>      qry = REQUEST.get('qry', '')
>      if qry == 'whatever':
>          # login user "testuser" in Zope
>          cookie_name='__ac'
>          cookie_value='xyz'
>          RESPONSE.setCookie( cookie_name, cookie_value, path='/')
>      else:
>          # ... user not logged in
>
>
> how does Zope know the user (username, password, roles, domains) who 
> is logged in?

Please keep this on the list.

Look at how the CookieCrumbler sets the cookie and replicate that. A 
cookie that you set in a request will only be read *during the next 
request*.

jens





More information about the Zope mailing list