PHP 5 has reached end of support and will bedeprecatedon January 31, 2026. After deprecation, you won't be able to deploy PHP 5
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing PHP
5 applications will continue to run and receive traffic after theirdeprecation date. We recommend that
youmigrate to the latest supported version of PHP.
Login URLsStay organized with collectionsSave and categorize content based on your preferences.
The Users API provides functions for constructing URLs that allow the user to sign in or sign out, then be redirected back to your application.
UserService::createLoginUrl()andUserService::createLogoutUrl()each take a destination URL for the application, and return a URL for signing in or signing out that redirects back to the given URL afterward.
use google\appengine\api\users\User;use google\appengine\api\users\UserService;$user = UserService::getCurrentUser();if (isset($user)) {echo sprintf('Welcome, %s! (<a href="%s">sign out</a>)',$user->getNickname(),UserService::createLogoutUrl('/'));} else {echo sprintf('<a href="%s">Sign in or register</a>',UserService::createLoginUrl('/'));}
The development web server simulates Google Accounts using its own sign-in and sign-out facilities. When you sign in to your application on the development web server, the server prompts you for an email address to use for the session. SeeThe Development Web Serverfor more information.
Tip:An easy way to restrict access to a part of your application to signed in users is to use thelogin: requiredconfiguration element for the URL handler. SeeConfiguring an App.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-15 UTC."],[],[]]