Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
5d3e4cce
Commit
5d3e4cce
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Fix phpdoc comments in SimpleSAML_SessionHandlerCookie plus a couple other minor fixes.
parent
701009c2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/SimpleSAML/Auth/Source.php
+1
-1
1 addition, 1 deletion
lib/SimpleSAML/Auth/Source.php
lib/SimpleSAML/SessionHandler.php
+0
-1
0 additions, 1 deletion
lib/SimpleSAML/SessionHandler.php
lib/SimpleSAML/SessionHandlerCookie.php
+27
-22
27 additions, 22 deletions
lib/SimpleSAML/SessionHandlerCookie.php
with
28 additions
and
24 deletions
lib/SimpleSAML/Auth/Source.php
+
1
−
1
View file @
5d3e4cce
...
...
@@ -7,7 +7,7 @@
* An authentication source is any system which somehow authenticate the user.
*
* @author Olav Morken, UNINETT AS.
* @package
s
impleSAMLphp
* @package
S
impleSAMLphp
*/
abstract
class
SimpleSAML_Auth_Source
{
...
...
This diff is collapsed.
Click to expand it.
lib/SimpleSAML/SessionHandler.php
+
0
−
1
View file @
5d3e4cce
...
...
@@ -170,5 +170,4 @@ abstract class SimpleSAML_SessionHandler
\SimpleSAML\Utils\HTTP
::
setCookie
(
$name
,
$value
,
$params
);
}
}
This diff is collapsed.
Click to expand it.
lib/SimpleSAML/SessionHandlerCookie.php
+
27
−
22
View file @
5d3e4cce
...
...
@@ -9,23 +9,31 @@
* session id.
*
* @author Olav Morken, UNINETT AS. <andreas.solberg@uninett.no>
* @package
s
impleSAMLphp
* @package
S
impleSAMLphp
* @abstract
*/
abstract
class
SimpleSAML_SessionHandlerCookie
extends
SimpleSAML_SessionHandler
{
/* This variable contains the current session id. */
/**
* This variable contains the current session id.
*
* @var string|null
*/
private
$session_id
=
NULL
;
/* This variable contains the session cookie name. */
/**
* This variable contains the session cookie name.
*
* @var string
*/
protected
$cookie_name
;
/*
This constructor initializes the session id based on what
* we receive in a cookie. We create a new session id and
set
* a cookie with this id if we don't have a session id.
/*
*
*
This constructor initializes the session id based on what
we receive in a cookie. We create a new session id and
*
set
a cookie with this id if we don't have a session id.
*/
protected
function
__construct
()
{
/* Call the constructor in the base class in case it should
...
...
@@ -41,7 +49,7 @@ extends SimpleSAML_SessionHandler {
/**
* Create and set new session id.
*
* @return string
The new session id.
* @return string The new session id.
*/
public
function
newSessionId
()
{
$this
->
session_id
=
self
::
createSessionID
();
...
...
@@ -55,7 +63,7 @@ extends SimpleSAML_SessionHandler {
/**
* Retrieve the session id of saved in the session cookie.
*
* @return string
The session id saved in the cookie.
* @return string The session id saved in the cookie.
*/
public
function
getCookieSessionId
()
{
if
(
$this
->
session_id
===
NULL
)
{
...
...
@@ -78,7 +86,7 @@ extends SimpleSAML_SessionHandler {
/**
* Retrieve the session cookie name.
*
* @return string
The session cookie name.
* @return string The session cookie name.
*/
public
function
getSessionCookieName
()
{
...
...
@@ -86,26 +94,23 @@ extends SimpleSAML_SessionHandler {
}
/*
This static function creates a session id. A session id consists
* of 32 random hexadecimal characters.
/*
*
*
This static function creates a session id. A session id consists
of 32 random hexadecimal characters.
*
* Returns:
* A random session id.
* @return string A random session id.
*/
private
static
function
createSessionID
()
{
return
bin2hex
(
openssl_random_pseudo_bytes
(
16
));
}
/*
This static function validates a session id. A session id is valid
* if it only consists of characters which are
allowed in a session id
* and it is the correct length.
/*
*
*
This static function validates a session id. A session id is valid
if it only consists of characters which are
*
allowed in a session id
and it is the correct length.
*
* Parameters:
* $session_id The session id we should validate.
* @param string $session_id The session ID we should validate.
*
* Returns:
* TRUE if this session id is valid, FALSE if not.
* @return boolean True if this session ID is valid, false otherwise.
*/
private
static
function
isValidSessionID
(
$session_id
)
{
if
(
!
is_string
(
$session_id
))
{
...
...
@@ -127,9 +132,9 @@ extends SimpleSAML_SessionHandler {
/**
* Check whether the session cookie is set.
*
* This function will only return
FALSE
if is is certain that the cookie isn't set.
* This function will only return
false
if is is certain that the cookie isn't set.
*
* @return bool
TRUE
if it was set,
FALSE if not
.
* @return bool
ean True
if it was set,
false otherwise
.
*/
public
function
hasSessionCookie
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment