In order to scale out your application on App Engine, you will need to 
rewrite your application to not save session information locally to disk or 
memory.

The most common way to do it on App Engine Standard is Memcache, but it is not 
yet available 
<https://cloud.google.com/appengine/docs/flexible/php/upgrading#memcache_service>
 on 
the Flexible environment. As detailed in this Stack Overflow answer by a 
Google engineer 
<https://stackoverflow.com/questions/48081962/session-between-servers-in-google-app-engine-flexible-php-environment>,
 
available options for App Engine Flexible PHP include storing session 
information in Cookies, using Cloud SQl <https://cloud.google.com/sql/docs/>
 or Cloud Datastore <https://cloud.google.com/datastore/>.

If you wish to troubleshoot your current session handling method I 
recommend you create a question on Stack Overflow using one of the tags 
<https://cloud.google.com/support/docs/stackexchange> monitored by our 
community technical support team, preferably including all of the relevant 
session-handling code and configuration.

On Wednesday, January 24, 2018 at 9:02:49 AM UTC-5, [email protected] 
wrote:
>
> My WebApp actually running on GCE and work correctly. I choose to migrate 
> into GAE for various reason: deploying, domain + ssl, system update and (as 
> soon as possible) for the scalabilty.
>
> But the problem is that the same deploy running on GCE or in local machine 
> not working on GAE, with the 2 cases i explaned. 
>
>
> Il giorno mercoledì 24 gennaio 2018 00:24:46 UTC+1, Yannick (Cloud 
> Platform Support) ha scritto:
>>
>> Hello, App Engine flexible doesn't do anything special regarding 
>> session/state support, which is handled at the level of the application's 
>> code. In case your code isn't accounting for them, you can read about the 
>> specific modifications that are done to requests before they are handed to 
>> your instance here 
>> <https://cloud.google.com/appengine/docs/flexible/java/how-requests-are-handled>
>> .
>>
>> By the way, if your service isn't going to scale past a single instance, 
>> is there a reason why your application needs to be in the Flexible 
>> environment and not simply on GCE?
>>
>> On Tuesday, January 23, 2018 at 11:19:04 AM UTC-5, [email protected] 
>> wrote:
>>>
>>> My WebApp is a Java + Primefaces based ERP.  Our user login generates a 
>>> session, and makes AJAX calls in order to update content without refreshing 
>>> or url changes. The JSF param "STATE_SAVING_METHOD" has a default value and 
>>> actually works fine on GCE with Tomcat and on a local machine with Jetty. 
>>> The GAE configuration is manual for only 1 istance.
>>>
>>> Case 1:
>>> - User X opens the WebApp
>>> - X inserts username/password. If correct, there's a messagge "Welcome 
>>> X" and a new cookie JSESSIONID
>>> - User Y opens the WebApp, from the same IP (different browser in same 
>>> computer or different computer in same network with static IP)
>>> - Y skips the login and see the message "Welcome X", without cookie 
>>> JSESSIONID generation
>>> - Y makes another action (e.g. click on "products" page), but instead of 
>>> opening it is redirected to the login screen.
>>> Why Y log in to automatically with X username?
>>>
>>> Case 2:
>>> - User opens the WebApp
>>> - He calls an action (with AJAX) and all works fine
>>> - User refreshes the page and all active actions (stored in session) are 
>>> hidden
>>> - If the user makes another action, the previous actions are restored 
>>> and the new action is added
>>> JSESSIONID mantains the same value for all the time.
>>>
>>> I think the problem is session or saving state related, and caused by 
>>> Load Balancer/GAE Flex.
>>> Did I missed any information about session/state that works differently 
>>> between GCE and GAE Flex?
>>>
>>> Thanks for your answers!
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/61601354-c0a4-4627-a283-031924552459%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to