# depicter/trunk/app/src/WordPress/SessionServiceProvider.php

Depicter — Popup &amp; Slider Builder, version trunk. 35 lines.

- Page: https://pluginprobe.com/plugins/depicter/trunk/code/app/src/WordPress/SessionServiceProvider.php
- Raw: https://pluginprobe.com/plugins/depicter/trunk/raw/app/src/WordPress/SessionServiceProvider.php
- Modified: 2022-06-01T06:26:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/depicter/trunk/code/app/src/WordPress/SessionServiceProvider.php#L10-L20`.

```php
<?php
namespace Depicter\WordPress;

use WPEmerge\ServiceProviders\ServiceProviderInterface;

/**
 * Register a session for Flash and OldInput to work with.
 */
class SessionServiceProvider implements ServiceProviderInterface {
	/**
	 * {@inheritDoc}
	 */
	public function register( $container ) {
		// Nothing to register.
	}

	/**
	 * {@inheritDoc}
	 */
	public function bootstrap( $container ) {
		add_action( 'init', [$this, 'startSession'] );
	}

	/**
	 * Start a new session.
	 *
	 * @return void
	 */
	public function startSession() {
		if ( session_status() === PHP_SESSION_NONE ) {
			session_start();
		}
	}
}

```
