[Seaside] Authorization, cookies, etc.

Kamil Kukura kamk@volny.cz
Mon, 17 Jun 2002 14:40:29 +0200

Jim Benson wrote:
> Ok, after reading through the Seaside archives ...
> I'm lost. Let me describe what I want to do:
> I have an application where I have serveral groups of users, each of these
> groups I'll call an account. Each account has several users associated with
> it, and an administrator for the account. The administrator manages the
> account by adding and deleting users. Standard stuff.
> I have a couple of Seaside pages devoted to this account maintenance. I want
> the administrator and users to have to log in to use the application.
> However, in standard web tradition, it's also OK to identify a user through
> the use of a cookie. I realized I don't know how to do that code wise. I
> know there's support in there somewhere for cookie support, but I don't know
> how to use it. I noticed this to be missing on the Comanche side also,
> there's really no simple "Here's how to get a cookie, here's how to set it"
> example that I was able to find.

Once I was building application also with users able to log in/out. I 
didn't care much about cookies or session IDs in URL. It was up to 
settings of application, particulary state of IAApplication>>sessionCookie.
I just subclassed IASession to have my own session class where I kept ID 
of user logged in and login time. Using such session the logic can be 
something like:

loginOkay ifTrue: [
	session isolate: [self callPage: WelcomeUser new].
	jumpToPage: HomePage new].

> The second part of the problem is, I want to 'invite' a new user to join the
> app. I send him an email saying "Point your browser to 'some URL' " which
> automatically sends him to the application page, and allows him to log in
> for the first time. Once he's in, he should bookmark the page as his
> application portal entry.

I was thinking about multiple entry points. That is, there would be 
'root' as the main entry point and then there would be dictionary of
aString -> aClass so that link http://somewhere/seaside/theapp/foobar 
could be resolved by mapping:

'foobar' -> IAFooBarComponent