You can also use Firestore for sessions, which I've serendipitously just added 
to the client library 
<https://github.com/googleapis/google-cloud-php/pull/2258>. I think this is 
the best way because 

   1. There is a free tier
   2. It's very simple to set up compared to a MySQL instance (no need to 
   set up a database/username/password).
   3. It's more "serverless" e.g. you don't configure instances.

I have a "getting started" tutorial for using sessions w/ App Engine and 
Firestore. It'll be at */php/getting-started/sessions*, so we can add it to 
the appengine navigation. Check out the code here 
<https://github.com/GoogleCloudPlatform/getting-started-php/pull/209>.

- Brent

On Wednesday, August 21, 2019 at 10:47:38 AM UTC-7, Jason Collins wrote:
>
> In GAE Std, for php72, the default session store is configured. This 
> default is `session.save_handler=files` which uses /tmp to store session 
> files.
>
> In GAE Std, each instance has its own /tmp and the /tmp is empty on any 
> cold start. So this is not really a viable option for session storage 
> (e.g., different requests from the same user may land on different 
> instances, and thus different sessions).
>
> You can use php.ini to configure an alternative (e.g., MySQL on Cloud SQL, 
> or Cloud Memorystore), but you need to do some set up work (e.g., create a 
> Cloud SQL instance, configure access).
>
> We need to have better documentation about this; I will create an internal 
> bug to have some created.
>
>
>
> On Wednesday, 21 August 2019 02:10:53 UTC-7, Andy Whittle wrote:
>>
>> Hi Jason,
>>
>> We're using whichever method GAE Standard env provides to store sessions.
>>
>> On Tuesday, August 20, 2019 at 2:40:24 AM UTC+1, Jason Collins wrote:
>>>
>>> How are you storing your sessions? Is it the /tmp folder default, or 
>>> have you used something like MySQL (Cloud SQL) to store sessions?
>>>
>>>
>>>

-- 
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 google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/2d92a98b-f684-4401-b484-fdcdc0dd8ad4%40googlegroups.com.

Reply via email to