Dissapearing attribute from session

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dissapearing attribute from session

MichalWie
Hello everyone,

I'm expecting bizarre behavior and  I'm slowly running out of options
what can be wrong. Maybe someone had a similar problem.

I've got a tapestry app (T5.5) and sometimes when I refresh pages (this
behavior I can see in many pages across my app), my session attributes are
lost. By "lost" I mean they are set as null, as they were never set. To be
more precise, I can observe this in a Map object that is stored in the
session.
I've observed that this loss is happening during a full page reload (in
other words, running ajax "hits" don't cause it).
What's more, this lost I can only see in my prod env (which in this case is
Azure). In my local development env, everything is working like a charm.

I know that this is only a brief description, but I don't even know what
details may be helpful with the solution to this problem.  Please ask and
thanks in advance.


--
regards,

MW
Reply | Threaded
Open this post in threaded view
|

Re: Dissapearing attribute from session

Cezary Biernacki
Hi,
Usually such symptoms appear when your production system has multiple
instances with a load balancer but without the "sticky sessions" option
enabled. The load balancer sends request from one user to multiple
instances, so it looks like attributes from the session disappear, while in
reality they were set on a different instances. This problem is unrelated
to Tapestry itself.

If your configuration matches above, either reconfigure your load balancer
to send request from one user to the same instance, or save/restore
sessions on every request from some external database.

Best regards,
Cezary



On Mon, 11 May 2020, 16:30 Michał Więckowski, <[hidden email]>
wrote:

> Hello everyone,
>
> I'm expecting bizarre behavior and  I'm slowly running out of options
> what can be wrong. Maybe someone had a similar problem.
>
> I've got a tapestry app (T5.5) and sometimes when I refresh pages (this
> behavior I can see in many pages across my app), my session attributes are
> lost. By "lost" I mean they are set as null, as they were never set. To be
> more precise, I can observe this in a Map object that is stored in the
> session.
> I've observed that this loss is happening during a full page reload (in
> other words, running ajax "hits" don't cause it).
> What's more, this lost I can only see in my prod env (which in this case is
> Azure). In my local development env, everything is working like a charm.
>
> I know that this is only a brief description, but I don't even know what
> details may be helpful with the solution to this problem.  Please ask and
> thanks in advance.
>
>
> --
> regards,
>
> MW
>