Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1047513
inp_session.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jun 30, 1:02 AM
Size
2 KB
Mime Type
text/x-php
Expires
Wed, Jul 2, 1:02 AM (11 h, 4 m)
Engine
blob
Format
Raw Data
Handle
677329
Attached To
rINP In-Portal
inp_session.php
View Options
<?php
/**
* @version $Id: inp_session.php 16794 2024-07-29 14:57:04Z alex $
* @package In-Portal
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined
(
'FULL_PATH'
)
or
die
(
'restricted access!'
);
class
InpSession
extends
Session
{
/**
* Enter description here...
*
* @var InpSessionStorage
* @access protected
*/
protected
$Storage
;
public
function
Init
(
$prefix
,
$special
)
{
$this
->
SessionTimeout
=
$this
->
Application
->
ConfigValue
(
'SessionTimeout'
);
$path
=
(
BASE_PATH
==
''
)
?
'/'
:
BASE_PATH
;
$this
->
SetCookiePath
(
$path
);
$cookie_name
=
$this
->
Application
->
ConfigValue
(
'SessionCookieName'
);
if
(
!
$cookie_name
)
{
$cookie_name
=
'sid'
;
}
$admin_session
=
(
$this
->
Application
->
isAdmin
&&
$special
!==
'front'
)
||
(
$special
==
'admin'
);
if
(
$admin_session
)
{
$cookie_name
=
'adm_'
.
$cookie_name
;
}
$this
->
SetCookieName
(
$cookie_name
);
$this
->
SetCookieDomain
(
SERVER_NAME
);
if
(
$admin_session
)
{
$mode
=
self
::
smAUTO
;
}
elseif
(
defined
(
'IS_INSTALL'
)
&&
IS_INSTALL
)
{
$mode
=
self
::
smCOOKIES_ONLY
;
}
else
{
$ses_mode
=
$this
->
Application
->
ConfigValue
(
'CookieSessions'
);
if
(
$ses_mode
==
2
)
{
$mode
=
self
::
smAUTO
;
}
elseif
(
$ses_mode
==
1
)
{
$mode
=
self
::
smCOOKIES_ONLY
;
}
elseif
(
$ses_mode
==
0
)
{
$mode
=
self
::
smGET_ONLY
;
}
else
{
$mode
=
self
::
smAUTO
;
}
}
$this
->
SetMode
(
$mode
);
parent
::
Init
(
$prefix
,
$special
);
}
function
Destroy
()
{
$this
->
Storage
->
DeleteSession
();
$this
->
Storage
->
DeleteEditTables
();
$this
->
Data
=
new
Params
();
$this
->
SID
=
$this
->
CachedSID
=
''
;
$this
->
SessionSet
=
false
;
if
(
$this
->
CookiesEnabled
)
{
$this
->
SetSessionCookie
();
//will remove the cookie due to value (sid) is empty
}
$this
->
SetSession
();
//will create a new session
}
}
Event Timeline
Log In to Comment