[Seaside] How can I access the authenticated user of a request?

Stephen Pair stephen at pairhome.net
Thu Oct 30 14:33:47 CET 2003


If you are using Comanche 6.2 and really want to access the current http 
request, "HttpRequest current" should do it (assuming that the 
Continuation mechanism is not getting in the way of looking up dynamic 
bindings...it may very well).  But, I agree with Avi that you should 
avoid making your Seaside apps dependent on the HTTP protocol.

- Stephen

Ian Prince wrote:

> On Mercredi, oct 29, 2003, at 09:50 Europe/Zurich, Avi Bryant wrote:
>
>> Ian Prince wrote:
>>
>>> P.S. on second thought wouldn't access to (say) request cookies be 
>>> useful for retrieving long-lasting seaside-session-independent user 
>>> preferences (e.g. retrieving an email address a user had previously 
>>> entered in a "old" seaside session).
>>
>>
>> I'm not a big fan of cookies - why not store that stuff server side?
>
>
> I agree.
>
> I might want to access the request headers for other information 
> though (User-Agent for example).
>
>> However, I can see that someone else might want to use them. My 
>> inclination, then, would be to have methods on session like 
>> #cookieAt: and #cookieAt:put:.  These would deal with requests (and 
>> responses) internally, but they wouldn't make you know anything about 
>> which headers are used to transmit cookies and so on.
>
>
> Do you have a code example of how I might refer to the request, say to 
> display the User-Agent?
>
> I must be missing something really obvious as I still can't see how I 
> can reference the request in my code. In Zope/DTML this is trivial - 
> just write <dtml-var REQUEST>.
>
> Thanks in advance.
>
> Ian.
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside





More information about the Seaside mailing list