Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Photogram Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rakesh K
Photogram Project
Commits
4a4896e2
Commit
4a4896e2
authored
3 years ago
by
Sibidharan
Browse files
Options
Downloads
Patches
Plain Diff
session
parent
8d08a4ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libs/includes/Session.class.php
+42
-0
42 additions, 0 deletions
libs/includes/Session.class.php
libs/load.php
+3
-1
3 additions, 1 deletion
libs/load.php
sg.php
+31
-0
31 additions, 0 deletions
sg.php
with
76 additions
and
1 deletion
libs/includes/Session.class.php
0 → 100644
+
42
−
0
View file @
4a4896e2
<?php
class
Session
{
public
static
function
start
()
{
session_start
();
}
public
static
function
unset
()
{
session_unset
();
}
public
static
function
destroy
()
{
session_destroy
();
}
public
static
function
set
(
$key
,
$value
)
{
$_SESSION
[
$key
]
=
$value
;
}
public
static
function
delete
(
$key
)
{
unset
(
$_SESSION
[
$key
]);
}
public
static
function
isset
(
$key
)
{
return
isset
(
$_SESSION
[
$key
]);
}
public
static
function
get
(
$key
,
$default
=
false
)
{
if
(
Session
::
isset
(
$key
))
{
return
$_SESSION
[
$key
];
}
else
{
return
$default
;
}
}
}
This diff is collapsed.
Click to expand it.
libs/load.php
+
3
−
1
View file @
4a4896e2
<?php
include_once
'includes/Session.class.php'
;
include_once
'includes/Mic.class.php'
;
include_once
'includes/User.class.php'
;
include_once
'includes/Database.class.php'
;
Session
::
start
();
function
load_template
(
$name
)
{
include
$_SERVER
[
'DOCUMENT_ROOT'
]
.
"/app/_templates/
$name
.php"
;
//not consistant.
...
...
This diff is collapsed.
Click to expand it.
sg.php
0 → 100644
+
31
−
0
View file @
4a4896e2
<pre>
<?php
// setcookie("testcookie", "testvalue", time() + (86400 * 30), "/");
include
'libs/load.php'
;
print
(
"_SESSION
\n
"
);
print_r
(
$_SESSION
);
print
(
"_SERVER
\n
"
);
print_r
(
$_SERVER
);
if
(
isset
(
$_GET
[
'clear'
]))
{
printf
(
"Clearing...
\n
"
);
Session
::
unset
();
}
if
(
Session
::
isset
(
'a'
))
{
printf
(
"A already exists... Value: "
.
Session
::
get
(
'a'
)
.
"
\n
"
);
}
else
{
Session
::
set
(
'a'
,
time
());
printf
(
"Assigning new value... Value:
$_SESSION[a]
\n
"
);
}
if
(
isset
(
$_GET
[
'destroy'
]))
{
printf
(
"Destroying...
\n
"
);
Session
::
destroy
();
}
?>
</pre>
\ No newline at end of file
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