Where to learn about sessions?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Where to learn about sessions?

Herbert König
Hi,

my scenario is:
A user logs in anonymously (or as a known user).
This creates a new instance of the model and leads the user into a
fresh viewMain.

Do I have to create a new AIDASite?
Actually I need to, as I don't want the navigation bar of aidademo.
Add a new session to an existing AIDASite?
How to go about it?



Thanks,

Herbert                          mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Where to learn about sessions?

Janko Mivšek
Hi Herbert,

Herbert König pravi:

> my scenario is:
> A user logs in anonymously (or as a known user).

So it doesn't log in at all? Ok, it logs if it is already registered...

Aida creates for every new visitor a new session object and assign a
guest user to it (a single instance of WebUser for all such sessions).

So, you have sessions and you have users, where a guest user is for
anonymous sessions.

When that user log in, the session's user is changed from guest to that
user's WebUser. Sessions therefore stays the same. This also enables one
user to have many sessions, from many browsers, one from pc, another
from notebook...

> This creates a new instance of the model and leads the user into a
> fresh viewMain.
>
> Do I have to create a new AIDASite?

No, not at all. You create a new model for each new session and register
it to session userValues, then you redirect him directly to that model.

When user will register himself, save this model to a user's otherValues
instead and use that one for further redirecting.

For redirection I propose to make a special Redirector and register it
as '/', then this redirector just redirects to the object stored in
user's or session's userValues.

> Actually I need to, as I don't want the navigation bar of aidademo.

Subclass WebStyle and do your own layout there. It will suffice to do
your own #pageFrameWith:title:

> Add a new session to an existing AIDASite?

As said above, this is done automatically for every new visitor.

Hope this help a bit
Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Where to learn about sessions?

Herbert König
Hi Janko,

tanks for the reply.
JM> Aida creates for every new visitor a new session object and assign a
where does this happen? Or to ask more correctly where do I hook in
the code which creates a new instance of my model?

Do I need to make an EnterSite object which in its viewMain creates a
new model and redirects there like you describe later? Or is there a
ready made way to do this?

JM> For redirection I propose to make a special Redirector and register it
JM> as '/', then this redirector just redirects to the object stored in
JM> user's or session's userValues.
Register with AidaSite... urlResolver registerURL:forObject:? Would
this be my EnterSite object?


JM> Hope this help a bit
Yes, a lot.

Thanks,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Where to learn about sessions?

Janko Mivšek
Hi Herbert, I hope I'm not too late with the answer.

Herbert König pravi:

> JM> Aida creates for every new visitor a new session object and assign a
> where does this happen? Or to ask more correctly where do I hook in
> the code which creates a new instance of my model

Put a lazy initiated method to the extension of WebSession in your
package. Like #mySessionRoot which will instantiate the root to sessions
userValues, when first called from your app:

        self session mySessionRoot

Session is otherwise created (or found the existing one) in
AIDASite>>answer: where you have:

        session := self sessionManager findOrMakeSessionFor: aRequest

> Do I need to make an EnterSite object which in its viewMain creates a
> new model and redirects there like you describe later? Or is there a
> ready made way to do this?

I can't remember better way to tho the redirection so ye, make this
EterSite redirector to redirect to above session #mySessionObject.


> JM> For redirection I propose to make a special Redirector and register it
> JM> as '/', then this redirector just redirects to the object stored in
> JM> user's or session's userValues.

> Register with AidaSite... urlResolver registerURL:forObject:? Would
> this be my EnterSite object?

Yes, and register your EnterSite object only once, that is have only one
instance of EnterSite (a singleton).

Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida