Skip to content

Instantly share code, notes, and snippets.

@rungta
Created January 31, 2025 10:24
Show Gist options
  • Save rungta/813f82d92e221b984eab7b716122b707 to your computer and use it in GitHub Desktop.
Save rungta/813f82d92e221b984eab7b716122b707 to your computer and use it in GitHub Desktop.
Craft CMS Session Cookie Prefix
<?php
// generates the session cookie prefix string used by Craft CMS to track
// logged-in user sessions: <prefix>_identity
use craft\web\User as WebUser;
echo md5('Craft.'.WebUser::class.'.'.sprintf('%s--%s', Craft::$app->id, 'production'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment