[Zope] cookies don't obey me

2000-10-09 Thread Roland Reumerman

I've been experiencing two problems with cookies from Zope:

1) When I set a cookie with the path set to the root
   
I'm still not able to click through to another hyperlink once I'm logged in, 
i.e., I've used www.ddi.nl/support to go the password protected Zope site, 
logged in as a customer, and from there I can choose other parts of the site 
(below .../support/). However, www.ddi.nl is an alias of 
www.datadistilleries.com (the actual name): as a result it asks me for the 
password again. I thought setting the path to '/' would convince Zope I'm 
authorized, but apparently it's not the case.

2) This might be related to 1. I've created a logout link on the 
.../support/index_html page, which looks as follows:

http://www.datadistilleries.com/support.html?section=m6&envelope=6')">
However, once I've been redirected I can still access the password protected 
.../support/ site without Zope asking me for a login name.

Now, I'm not 'cookie guru', so please don't tell me how stupid it is of me 
that I didn't think of this or that to make it work. I did do my background 
research homework though!

Thanks for reading this far ;-).

RCR


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] cookies don't obey me

2000-10-10 Thread Dieter Maurer

Roland Reumerman writes:
 > 1) When I set a cookie with the path set to the root
 >
Be careful with "cookies"!
The value of a cookie it quite severely restricted (must not contain
many characters; you read the cookie specification?).
In your case, the value is not a string at all but a
Zope object. "RESPONSE.setCookie" will probably convert the
object to a string for you. This will give you
"AUTHENTICATED_USER.getUsername()". However, I would feel
better, if this would be in your "setCookie" call.

Note, that probably Zope user names may contain characters not
allowed in Cookie values.

 > I'm still not able to click through to another hyperlink once I'm logged in, 
 > i.e., I've used www.ddi.nl/support to go the password protected Zope site, 
 > logged in as a customer, and from there I can choose other parts of the site 
 > (below .../support/). However, www.ddi.nl is an alias of 
 > www.datadistilleries.com (the actual name): as a result it asks me for the 
 > password again. I thought setting the path to '/' would convince Zope I'm 
 > authorized, but apparently it's not the case.
The path is a "local" path on your server.
Setting "path='/'" tells the browser to add the cookie to
any request going to your server. "path='/'" would tell
the browser to send it only for requests with paths beginning
with "/".
You cannot control with "path" to what server the cookie is
sent. There is the "domain" specification that gives you
some control over the servers that get the cookie.
I doubt, however, that this mechanism will allow you to 
send cookies defined by "www.ddi.nl" also to
"www.datadistilleries.com".

 > 2) This might be related to 1. I've created a logout link on the 
 > /support/index_html page, which looks as follows:
 > 
 >  
 >"RESPONSE.redirect('http://www.datadistilleries.com/support.html?section=m6&envelope=6')">
 > However, once I've been redirected I can still access the password protected 
 > /support/ site without Zope asking me for a login name.
There must be some magic, you did not yet tell us about.

Usually, setting a cookie has nothing to do with password
protection or authentication.

There must be something like a "login manager" that ties
Zope's security subsystem, login/logout and cookies together.
Usually, this "login manager" would do the cookie handling
transparently.

That you are concerned with the cookie seems to indicate
that you implement your own "login manager"?

The built in Zope authentication does not use cookies at all
but "basic authentication" as defined by HTTP.


Dieter


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )