mirror of
				https://github.com/Mibew/mibew.git
				synced 2025-10-31 18:41:10 +03:00 
			
		
		
		
	Remove "is_secure_request" function
This commit is contained in:
		
							parent
							
								
									fe0d2f2760
								
							
						
					
					
						commit
						6066b9312e
					
				| @ -29,10 +29,3 @@ function get_get_param($name, $default = '') | ||||
| 
 | ||||
|     return $value; | ||||
| } | ||||
| 
 | ||||
| function is_secure_request() | ||||
| { | ||||
|     return (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') | ||||
|         || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") | ||||
|         || (isset($_SERVER["HTTP_HTTPS"]) && $_SERVER["HTTP_HTTPS"] == "on"); | ||||
| } | ||||
|  | ||||
| @ -44,17 +44,21 @@ require_once(MIBEW_FS_ROOT . '/libs/common/request.php'); | ||||
| require_once(MIBEW_FS_ROOT . '/libs/common/response.php'); | ||||
| require_once(MIBEW_FS_ROOT . '/libs/common/string.php'); | ||||
| 
 | ||||
| // We need to get some info from the request. Use symfony wrapper because it's
 | ||||
| // the simplest way.
 | ||||
| $tmp_request = \Symfony\Component\HttpFoundation\Request::createFromGlobals(); | ||||
| 
 | ||||
| // Make session cookie more secure
 | ||||
| @ini_set('session.cookie_httponly', true); | ||||
| if (is_secure_request()) { | ||||
| if ($tmp_request->isSecure()) { | ||||
|     @ini_set('session.cookie_secure', true); | ||||
| } | ||||
| @ini_set( | ||||
|     'session.cookie_path', | ||||
|     \Symfony\Component\HttpFoundation\Request::createFromGlobals()->getBasePath() . "/" | ||||
| ); | ||||
| @ini_set('session.cookie_path', $tmp_request->getBasePath() . "/"); | ||||
| @ini_set('session.name', 'MibewSessionID'); | ||||
| 
 | ||||
| // Remove temporary request to keep global scope clean.
 | ||||
| unset($tmp_request); | ||||
| 
 | ||||
| // Initialize user session
 | ||||
| session_start(); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user