"receiver of session is nil"

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

"receiver of session is nil"

Bernat Romagosa
Hi list,

When a session has expired and I try to access my app, I get a "receiver of session is nil" error (I just ignore it and re-try to access the app, then it works).

Is there something I'm doing wrong? How should one handle session expiration?

Thanks!

Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: "receiver of session is nil"

sebastien audier

Hi,

Which version number of Iliad is it ?

I tried it on 0.9.1.1, and it works.

Best regards,

--
Sébastien AUDIER

ObjectFusion S.A.R.L.
Applications web, consulting, design
http://www.objectfusion.fr
Reply | Threaded
Open this post in threaded view
|

Re: "receiver of session is nil"

ZuLuuuuuu
In reply to this post by Bernat Romagosa
Bernat Romagosa wrote
Hi list,

When a session has expired and I try to access my app, I get a "receiver of
session is nil" error (I just ignore it and re-try to access the app, then
it works).

Is there something I'm doing wrong? How should one handle session
expiration?

Thanks!

Bernat Romagosa.
Some code at where the error occurs might be helpful for us.

By the way, the documentation's "Managing sessions" section is very helpful. Here is how to handle session expirations:

http://doc.iliadproject.org/#Handling-session-expiration
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: "receiver of session is nil"

Bernat Romagosa
My version is 0.9.1-SA.

I've just tried to inspect a currently active session, run self expire then access the website.

Here's the whole stack dump: http://pastie.org/1707998

Maybe I should add I'm running in debugMode, in deploymentMode (of course) I don't get any error, but I still got to refresh the page to access it.

Bernat Romagosa
Reply | Threaded
Open this post in threaded view
|

Re: "receiver of session is nil"

Bernat Romagosa
Thanks Nico, I managed to understand it and fix it. I was not implementing onExpire the right way :)

Bernat.

2011/3/30 Nicolas Petton <[hidden email]>
IIRC it works this way so the expiring session has a chance to handle
the request and you can trigger some action and display infos to the
user.

See ILApplicationHandler>>handleRequest and ILSession>>onExpire

Cheers,
Nico

Le mercredi 30 mars 2011 à 18:26 +0200, AxiNat a écrit :
> Excuse the mail bombing... this error is really bugging me:
>
>
> findOrMakeSessionFor: aRequest
> "Answer a valid session for <aRequest>.
> Create a new session if no session is found"
>
> | session id |
> id := self sessionIdFromRequest: aRequest.
> session := sessions at: id ifAbsent: [^self newSession].
> session isExpired
> ifFalse: [
> session setModifiedTimestamp.
> ^session]
> ifTrue: [
> self removeSession: session.
> ^self session]
>
>
> When the session is expired, we remove it, and then return self
> session, but:
>
>
> session
> ^self context session
>
>
> When I debug it, self context returns nil, so I guess there's the
> source of the problem, but I couldn't dig deeper because I don't
> understand how ILCurrentContext works :(
>
>
> Any help would be very appreciated.
>
>
> Thanks again!
>
>
> Bernat.
>
> 2011/3/30 AxiNat <[hidden email]>
>         Oops sorry, false alarm! That was not the issue...
>
>
>
>         2011/3/30 AxiNat <[hidden email]>
>                 I think I just found out what was going on...
>
>
>                 I was checking whether the visitor was using IE in my
>                 ILApplication >> index as follows:
>
>
>                         index
>                                 ^ [ :h |
>                                         self context request
>                                         nativeRequest isFromMSIE
>                                                 ifTrue: [ h html: self
>                                                 ieUserPage ]
>                                                 ifFalse: [ h build:
>                                                 self pageStructure ] ]
>
>
>                 I changed it to:
>
>                         index
>                                 ^ [ :h |
>                                         (self session user isNil and:
>                                         [ self context request
>                                         nativeRequest isFromMSIE ])
>                                                 ifTrue: [ h html: self
>                                                 ieUserPage ]
>                                                 ifFalse: [ h build:
>                                                 self pageStructure ] ]
>
>
>
>                 And now it seems to work as expected when the session
>                 expires.
>
>
>                 Cheers,
>
>
>                 Bernat.
>
>
>
>