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
dharaneesh . r ravi
photogram project
Commits
fb5a654e
Commit
fb5a654e
authored
1 year ago
by
dharaneesh . r ravi
Browse files
Options
Downloads
Patches
Plain Diff
introduction to session
parent
49f43452
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libs/includes/Session.class.php
+28
-0
28 additions, 0 deletions
libs/includes/Session.class.php
libs/load.php
+2
-0
2 additions, 0 deletions
libs/load.php
sg.php
+71
-0
71 additions, 0 deletions
sg.php
test.php
+1
-10
1 addition, 10 deletions
test.php
with
102 additions
and
10 deletions
libs/includes/Session.class.php
0 → 100644
+
28
−
0
View file @
fb5a654e
<?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
+
2
−
0
View file @
fb5a654e
...
...
@@ -3,6 +3,8 @@
include_once
"includes/Mic.class.php"
;
include_once
"includes/Database.class.php"
;
include_once
"includes/User.class.php"
;
include_once
"includes/Session.class.php"
;
Session
::
start
();
//this function load all the file
function
load_templates
(
$name
)
{
// print("including $name.php");
...
...
This diff is collapsed.
Click to expand it.
sg.php
0 → 100644
+
71
−
0
View file @
fb5a654e
<pre>
<?php
include
"libs/load.php"
;
// print("_SERVER\n");
// print_r($_SERVER);
// print("_GET\n");
// print_r($_GET);
// print("_POST\n");
// print_r($_POST);
// print("_FILES\n");
// print_r($_FILES);
// print("_COOKIE\n");
// print_r($_COOKIE);
// print("_SESSION");
// print_r($_SESSION);
/**
*
*before the object class is used
*/
// if(isset($_GET['clear'])){
// print("clearing.....");
// session_unset();
// }
// if(isset($_SESSION['a']))
// {
// print("\na already exists... value :$_SESSION[a]");
// }
// else
// {
// $_SESSION['a']=time();
// print("\nassigning new value ...:$_SESSION[a]");
// }
// if(isset($_GET['destroy']))
// {
// print("destroying.....");
// session_destroy();
// }
/**
* after the object class is used
*/
print
(
"_SESSION"
);
print_r
(
$_SESSION
);
if
(
isset
(
$_GET
[
'clear'
])){
print
(
"clearing....."
);
Session
::
unset
();
}
if
(
Session
::
isset
(
'a'
))
{
print
(
"
\n
a already exists... value :"
.
Session
::
get
(
'a'
)
.
"
\n
"
);
}
else
{
Session
::
set
(
'a'
,
time
());
print
(
"
\n
assigning new value ...:"
.
Session
::
get
(
'a'
)
.
"
\n
"
);
}
if
(
isset
(
$_GET
[
'destroy'
]))
{
print
(
"destroying....."
);
Session
::
destroy
();
}
?>
</pre>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
test.php
+
1
−
10
View file @
fb5a654e
<?php
include
"libs/load.php"
;
// print("_SERVER\n");
// print_r($_SERVER);
// print("_GET\n");
// print_r($_GET);
// print("_POST\n");
// print_r($_POST);
// print("_FILES\n");
// print_r($_FILES);
// print("_COOKIE\n");
// print_r($_COOKIE);
// testing the signup function
// if (signup("sam", "password", "sam@123", "6369239993")) {
// echo "success";
...
...
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