"receiver of session is nil"

0 views
Skip to first unread message

AxiNat

unread,
Mar 24, 2011, 7:18:30 AM3/24/11
to il...@googlegroups.com
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.

sebastien audier

unread,
Mar 24, 2011, 7:48:58 AM3/24/11
to il...@googlegroups.com, AxiNat

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

ZuLuuuuuu

unread,
Mar 24, 2011, 8:21:59 AM3/24/11
to il...@googlegroups.com

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
--
View this message in context: http://forum.world.st/receiver-of-session-is-nil-tp3402231p3402337.html
Sent from the Iliad mailing list archive at Nabble.com.

AxiNat

unread,
Mar 24, 2011, 8:46:10 AM3/24/11
to il...@googlegroups.com
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

AxiNat

unread,
Mar 30, 2011, 11:44:42 AM3/30/11
to il...@googlegroups.com
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.

AxiNat

unread,
Mar 30, 2011, 11:51:27 AM3/30/11
to il...@googlegroups.com
Oops sorry, false alarm! That was not the issue...

2011/3/30 AxiNat <tibabenfor...@gmail.com>

AxiNat

unread,
Mar 30, 2011, 12:26:21 PM3/30/11
to il...@googlegroups.com
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 <tibabenfor...@gmail.com>

Nicolas Petton

unread,
Mar 30, 2011, 1:15:38 PM3/30/11
to il...@googlegroups.com
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

AxiNat

unread,
Mar 31, 2011, 9:22:37 AM3/31/11
to il...@googlegroups.com
Thanks Nico, I managed to understand it and fix it. I was not implementing onExpire the right way :)

Bernat.

2011/3/30 Nicolas Petton <petton....@gmail.com>
Reply all
Reply to author
Forward
0 new messages