Basic session management

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

Basic session management

ZuLuuuuuu-2
Hello,

I have an application which requires login. I want to remember the
login information throughout the usage once entered. For example, the
member name and the password.

My first question is to confirm that I should subclass the ILSession
and add instance variables like memberName and password, then add
accessors etc?

Then I might use ILSessionManager sessionClass: MySessionSubclass so
that it uses this new session class. But my applications might need to
use different session classes, so my second question is if there is a
way to assign different session classes for different applications?
Reply | Threaded
Open this post in threaded view
|

Re: Basic session management

Steven Costiou
Hi,

yes you have to do exactly like this - i mean i do that myself and it works perfectly fine, i don't think there's a more simple way to do it =)

Your last question is a good one :/ 

You have the possibility to manually add your a session, with:

ILSessionManager current addSession:
aSession

You can then add different sessions, depending of your application. However - and that i cannot tell yet - you have to explicitly call this method with your session when you do initialize an application.

I did not check yet, but i think it's quite simple ;)

;)

-Steven Costiou-



2010/6/4 ZuLuuuuuu <[hidden email]>
Hello,

I have an application which requires login. I want to remember the
login information throughout the usage once entered. For example, the
member name and the password.

My first question is to confirm that I should subclass the ILSession
and add instance variables like memberName and password, then add
accessors etc?

Then I might use ILSessionManager sessionClass: MySessionSubclass so
that it uses this new session class. But my applications might need to
use different session classes, so my second question is if there is a
way to assign different session classes for different applications?

Reply | Threaded
Open this post in threaded view
|

Re: Basic session management

Nicolas Petton


Your last question is a good one :/ 

You have the possibility to manually add your a session, with:

ILSessionManager current addSession:
aSession

You can then add different sessions, depending of your application. However - and that i cannot tell yet - you have to explicitly call this method with your session when you do initialize an application.

No, this won't work. The instance of session is shared across all application instances.

Depending on your exact needs, you can store data in the application itself, since applications are stateful. There is only one instance of the same application class per session (per client).

Cheers,
Nico

Reply | Threaded
Open this post in threaded view
|

Re: Basic session management

ZuLuuuuuu-2


On Jun 4, 8:54 pm, nicolas petton <[hidden email]> wrote:
> Depending on your exact needs, you can store data in the application itself,
> since applications are stateful. There is only one instance of the same
> application class per session (per client).
>
> Cheers,
> Nico

I've never thought of that, it's much simpler, thanks...