Session::generate_id()

Description #

Generate a cryptographically strong unique ID for the session token.

Source #

File: includes/class/class-session.php

	protected function generate_id() {
		if ( ! class_exists( 'PasswordHash' ) ) {
			require_once ABSPATH . 'wp-includes/class-phpass.php';
		}

		$hasher = new \PasswordHash( 8, false );

		return md5( $hasher->get_random_bytes( 32 ) );
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment