Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

WebGL PHPSESSID Cookie not persisting

Discussion in 'Web' started by michaelnoinc, Sep 19, 2017.

  1. michaelnoinc

    michaelnoinc

    Joined:
    Jan 16, 2017
    Posts:
    3
    I have run into a problem where my unityWebRequest calls have a new sessionID each time they are called. This causes the user to become unauthorized right after logging in.

    The app works fine with http.request for all other builds, this is only when switching to UnityWebRequest which was necessary to build the app for WebGL.

    I've tried managing the session cookie manually but that doesn't seem to be an option as we don't have access to the cookie headers in webGL. I've tried accessing them from a jslib file with no luck as well.

    I'm not getting any errors for cors anymore, just a different session cookie on checking for authenticated login.

    There doesn't seem to be anybody else having this problem so it might be server-related but I can't seem to figure it out. Any help with what might be the problem would be appreciated!

    Currently on Unity 5.5.0f3
    we're hosting as staic files in S3 - the server we are trying to access is Amazon linux
    running Symfony on php7.0 and apache



    Edit:
    After about two weeks of searching, I finally found the answer I needed!
    https://forum.unity.com/threads/webgl-cors-and-xmlhttprequest-withcredentials.438004/
     
    Last edited: Sep 21, 2017