Skip to main content
Participating Frequently
October 6, 2022
Question

Session Sharing between Redis and CF2021 container.

  • October 6, 2022
  • 4 replies
  • 512 views

Hello,

We are having some issues sharing sessions between Redis and CF2021 container. 

Is there any trouble shooting guide? or anyone has any suggestions?

Regards

    This topic has been closed for replies.

    4 replies

    bryan1715
    Participant
    February 25, 2023

    We have found that storing CF components in the session causes problems as ACF is unable to deserialize the component after receiving the session object from Redis.  I am not sure if that is the same issue Charlie Arehart was talking about when he refered to "certain Java objects", but we worked around it by not storing the object in the session, but rather stored all instance varaibles for the object in a struct in the session and get a new instance of the object in any request that needs it.  That may introduce a bit more overhead when the object is needed, but allowing us to autoscale our app and eliminate sticky sessions is worth it in our case.

    CF NinjaAuthor
    Participating Frequently
    June 9, 2023

    There are a lot of objects stored in the session. Maybe, this is my issue as well. Thanks for the response.

    BKBK
    Community Expert
    Community Expert
    December 6, 2022
    Charlie Arehart
    Community Expert
    Community Expert
    October 6, 2022

    No guide, sadly. There are too many variables that can affect things, really. You can help us help you, though.

     

    First, are you saying the problem happens ONLY when running CF as a container? Or can you confirm if the problem happens for you also if running CF as a normal process/installer? (Or have you only tried in a container?) And are you using the Adobe CF 2021 image? or the one from Commandbox?

     

    Second, where is the redis relative to your CF? And is redis running as container also, if "local" to your CF container? Either way, are they in the same network? 

     

    Third, what problem are you having? Are you getting a message? Is it intermittent or not working at all? Might it be that data is failing to persist appropriately, such as over restarts?

     

    Or might it be failing only when trying to store only certain data? I helped a client who had a problem with using certain java objects stored in a session, where their serialization didn't work. (I just checked and they've not yet filed that bug report with the details.)

     

    Maybe someone else may offer still other ideas or questions. The feature does and should work. When it doesn't, there's an explanation, which simply needs to be discovered.

    /Charlie (troubleshooter, carehart. org)
    CF NinjaAuthor
    Participating Frequently
    June 9, 2023

    1. Yes, my issue happens only when CF is running in a docker container. 

    2. Redis is also running in a container. Both Redis and CF have networks: default in docker-compose.yml.

     

    redis:

      networks:

       - default

    3. Session something does not exist.

     

    This application has a lot of objects stored in session. Perhaps, this is my problem.

    Community Expert
    October 6, 2022

    What's in the logs?

     

    Dave Watts, Eidolon LLC

    Dave Watts, Eidolon LLC