S.hostAndPath

43 views
Skip to first unread message

Andreas Joseph Krogh

unread,
Aug 4, 2015, 6:54:46 AM8/4/15
to lif...@googlegroups.com
Hi all.
 
Any reason why S.hostAndPath doesn't lookup in session when the Req is Empty (like in CometActors)? S.contextPath gets the info from session when Req is Empty, which makes it work in CometActors also. It seems to me like the info building up S.hostAndPath also could exist in session so it could work in CometActors.
 
Thoughts?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963

Antonio Salazar Cardozo

unread,
Aug 4, 2015, 6:10:34 PM8/4/15
to Lift
Do you have a specific place where hostAndPath info would live in the session? Or are you
saying we should start putting it in the session?
Thanks,
Antonio

Andreas Joseph Krogh

unread,
Aug 5, 2015, 4:12:54 AM8/5/15
to lif...@googlegroups.com
På onsdag 05. august 2015 kl. 00:10:33, skrev Antonio Salazar Cardozo <savedf...@gmail.com>:
Do you have a specific place where hostAndPath info would live in the session? Or are you
saying we should start putting it in the session?
Thanks,
Antonio
 
I'm saying there's nothing preventing us form storing this information in the session when initing the session, unless I'm missing something.

Antonio Salazar Cardozo

unread,
Aug 5, 2015, 4:16:32 PM8/5/15
to Lift
Well, path is request-dependent, no? And host could also be request-dependent, if say
you're sending the same cookie via two different URIs (subdomains for example). So I
don't think putting it in the session is a good idea :/

On the other hand, it might be interesting to include the Req or some vestigial version
of it in Listen messages to the CometActor, so it can capture information about a given
long-poll request if needed.
Thanks,
Antonio

Andreas Joseph Krogh

unread,
Aug 5, 2015, 4:43:27 PM8/5/15
to lif...@googlegroups.com
På onsdag 05. august 2015 kl. 22:16:31, skrev Antonio Salazar Cardozo <savedf...@gmail.com>:
Well, path is request-dependent, no? And host could also be request-dependent, if say
you're sending the same cookie via two different URIs (subdomains for example). So I
don't think putting it in the session is a good idea :/
 
On the other hand, it might be interesting to include the Req or some vestigial version
of it in Listen messages to the CometActor, so it can capture information about a given
long-poll request if needed.
Thanks,
Antonio
 
I cannot see how the path in question (the context-path that is) request-dependent. Can you explain when this is the case?
The multi-host case (sub-domains) I haven't thought of...

Antonio Salazar Cardozo

unread,
Aug 5, 2015, 11:00:24 PM8/5/15
to Lift
Just realized hostAndPath is only the context path, not including the path to the template
heh. My bad, that's not a concern :) Context path is actually known by the session, and
fetchable via S.contextPath, which will look up in the session if there is no current request.
Thanks,
Antonio

Andreas Joseph Krogh

unread,
Aug 6, 2015, 2:45:25 AM8/6/15
to lif...@googlegroups.com
På torsdag 06. august 2015 kl. 05:00:24, skrev Antonio Salazar Cardozo <savedf...@gmail.com>:
Just realized hostAndPath is only the context path, not including the path to the template
heh. My bad, that's not a concern :) Context path is actually known by the session, and
fetchable via S.contextPath, which will look up in the session if there is no current request.
Thanks,
Antonio
 
I know S.contextPath now works transparently in CometActors as in snippets (didn't before 3.0), but I need S.hostAndPath to work similarly transparent. It's not a blocker for me as it's quite trivial to manually craft such a thing which provides host+port+contextPath for my app.

Antonio Salazar Cardozo

unread,
Aug 6, 2015, 3:02:42 PM8/6/15
to Lift
Yeah, I'm thinking we can't provide a proper guarantee that host will stay stable
across a session, but we can advise users who need it that they can stash the
hostAndPath in a SessionVar when they need it, which they can then access from
a comet actor.
Thanks,
Antonio
Reply all
Reply to author
Forward
0 new messages