Re: [Lift] Re: Strange repeatedly reloading of webpages in IE9
Jeppe Nejsum Madsen <
jeppe@...>
2012-06-16 10:38:23 GMT
If your site requires cookies to work, it might be better to check if
cookies are enabled (this is relatively easy, I have some code if
needed) and redirect to some error page up front
/Jeppe
On Fri, Jun 15, 2012 at 9:04 PM, Antonio Salazar Cardozo
<savedfastcool@...> wrote:
> The only issue you run into is that the
> redirectAjaxOnSessionLoss/noCometSessionPage combination is not only hit
> when there are no cookies, it's also hit when your session expires. So if
> someone is on your site, shuts their laptop, leaves for 20 minutes (so the
> session and comets die), pops open their laptop, you'll be hitting the above
> flow. This is why it's even better with noCometSessionCmd, so that you can
> call a function that will know if you already had a successful comet
> connection.
>
> The other case where you'd hit it is if you restarted the server (say, to
> deploy new code). That would be harder to spot, but if you send, through
> existing comet actors, a message to the client to put it in a state where
> it's expecting the server restart, then again a custom command could be used
> to check for that state and reload the page instead of giving you a cookie
> error.
> Thanks,
> Antonio
>
> On Thursday, June 14, 2012 6:59:52 PM UTC-4, Dave wrote:
>>
>> Thanks Antonio,
>> that might be an elegant way to handle a cookie blocking situation for
>> comet.
>>
>> On 14 jun, 20:00, Antonio Salazar Cardozo <savedfastc...@...>
>> wrote:
>> > It may be possible to do this using a responseTransformer… Basically
>> > hunt
>> > down all hrefs and srcs and run them through whatever function. But
>> > you'd
>> > have to tweak the actual comet paths as well, which may be doable by
>> > playing with the LiftRules.ajaxPath and LiftRules.cometPath variables.
>> > The
>> > problem is these are static variables instead of functions or factories
>> > (so
>> > they're not generated per-session or anything).
>> >
>> > More to the point, you can set things up so that instead of reloading
>> > the
>> > page, a lack of comets leads to an error message. If you turn off
>> > LiftRules.redirectAjaxOnSessionLoss, the page will instead of reloading
>> > be
>> > directed to a URI of your choice. You set the URI to redirect to using
>> > LiftRules.noCometSessionPage. At some point I want to make this
>> > noCometSessionCmd, so that you can actually use arbitrary JS instead of
>> > only being able to redirect.
>> >
>> > So it is possible to set it up so that when this error condition comes
>> > up,
>> > the user is sent to an error message page that explains the problem (and
>> > requests that they go through whatever process to allow your cookies).
>> >
>> > Hope that helps!
>> > Thanks,
>> > Antonio
>> >
>> >
>> >
>> > On Thursday, June 14, 2012 6:28:14 AM UTC-4, Jeppe Nejsum Madsen wrote:
>> >
>> > > On Thu, Jun 14, 2012 at 10:55 AM, Naftoli Gugenheim
>> > > <naftoli...@...> wrote:
>> > > > Oh, so is there any reason comet, etc., wouldn't work for the OP
>> > > > with
>> > > that
>> > > > configured?
>> >
>> > > In theory no, but it requires all URL-generating functions are passed
>> > > through the encodeURL function (to append the jsessionid parameter)
>> > > and afaik, this is not done in Lift.
>> >
>> > > /Jeppe
>> >
>> > > > On Thu, Jun 14, 2012 at 4:42 AM, Jeppe Nejsum Madsen
>> > > > <je...@...>
>> > > > wrote:
>> >
>> > > >> On Thu, Jun 14, 2012 at 8:13 AM, Naftoli Gugenheim <
>> > > naftoli...@...>
>> > > >> wrote:
>> >
>> > > >> > On Wed, Jun 13, 2012 at 6:01 PM, Dave
>> > > >> > <dave.mahabiers...@...>
>> >
>> > > >> > wrote:
>> >
>> > > >> >> If I want to make a cookie free website with comet (or other
>> > > >> >> functionality) is this possible in liftweb (or reactive web)?
>> >
>> > > >> > You can't have a servlet container session without cookies ---
>> > > >> > can
>> > > you
>> > > >> > enable cookies named JSESSIONID for all sites?
>> > > >> > Otherwise you need to deal on a much lower level, maybe with raw
>> > > >> > web
>> > > >> > sockets.
>> >
>> > > >> That is not correct. Most (all?) servlet containers support
>> > > >> cookie-less sessions (e.g.
>> >
>> >
>> > > >http://www.mojavelinux.com/blog/archives/2006/11/disabling_session_co...).
>> >
>> > > >> But this requires all URLs to go through an "encodeURL" method to
>> > > >> append the session id to the URL.
>> >
>> > > >> /Jeppe
>> >
>> > > >> --
>> > > >> Lift, the simply functional web framework:http://liftweb.net
>> > > >> Code:http://github.com/lift
>> > > >> Discussion:http://groups.google.com/group/liftweb
>> > > >> Stuck? Help us help you:
>> > > >>https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>> >
>> > > > --
>> > > > Lift, the simply functional web framework:http://liftweb.net
>> > > > Code:http://github.com/lift
>> > > > Discussion:http://groups.google.com/group/liftweb
>> > > > Stuck? Help us help you:
>> > > >https://www.assembla.com/wiki/show/liftweb/Posting_example_code-
>> > > > Tekst uit oorspronkelijk bericht niet weergeven -
>> >
>> > - Tekst uit oorspronkelijk bericht weergeven -
>
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code