SlideShare a Scribd company logo
Get and post,session and cookie
Yasirmusthafa pp
yasirmusthafapp@gmail.com
www.facebook.com/yasirmusthafa
twitter.com/yasirmusthafapp
in.linkedin.com/in/yasirmusthafapp
8891396749
GET andPOST,sessionand cookie
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
GET & POST
• 2 methods
• Form data sent from client to server
GET method
GET method
• The data send along the query string
<form action=“registration.php” method=“get”>
• $_GET function is used to collect values in a
form with method=“get".
• Can seen in the url
• Can be bookmarked
• Not suitable for sending password or sensitive
data
• Cant send values exceeding 2000 characters
POST method
POST method
• $_POST function is used to collect values in a
form with method="post".
<form action=“registration” method=“post”>
• Invisible in url
• Cant be bookmarked
• Suitable for sending sensitive data
• 8 mb size by default
GET & POST
GET
• Seen in url
• Can be bookmarked
• Not suitable for sending
sensitive data
• Max size=2000 characters
POST
• Invisible in url
• Cant bookmarked
• Suitable for sending
sensitive data
• Max size=8 mb
Session &Cookie
• Used to maintain the states of http request
Session
• A PHP session variable is used to store
information about, or change settings for a
user session.
• Session variables hold information about one
single user, and are available to all pages in
one application.
Session
Starting php session
Session_start()
Storing a session variable
$_SESSION['intUserId']=$arrUser['pk_int_user_id'];//set session variable
Accessing a session variable
$user_id=$_SESSION['intUserId'];
Destroying a session variable
1. Unset($_SESSION[‘intUserId’])
2. Session_destroy()
Cookie
• A cookie is often used to identify a user.
• A cookie is a small file that the server embeds
on the user's computer.
• Each time the same computer requests a page
with a browser, it will send the cookie too.
Cookie
Create cookie
setcookie("intUserId",$intValue,time()+600);//create cookie variable
Access cookie
$intUserId=$_COOKIE['intUserId'];
Unset cookie
setcookie("intUserId", "", time()-600);//unset cookie
Session &Cookie
Session
• Stored in server
• Lost when browser close
• Store string and object
• Use future reference
cookie
• Stored in browser
• Don’t lose when browser
close
• Only store string
• Cant use
THANK YOU
Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course
@ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designed
to make a quick, good software professional out of anybody who holds a passion for coding.
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square,
Hilite Business Park,
Near Pantheerankavu,
Kozhikode
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com
Contact Us

More Related Content

PPTX
Web performance
ODP
WordPress optimization
PPT
Angular js How, What & Why - MetaRefresh 2014
PPTX
Introduction to Jquery
PPT
Embedded powerpointexample
PPTX
Html5 Fit: Get Rid of Love Handles
PPTX
12 acronym applet_bdo
PPTX
27 iframe
Web performance
WordPress optimization
Angular js How, What & Why - MetaRefresh 2014
Introduction to Jquery
Embedded powerpointexample
Html5 Fit: Get Rid of Love Handles
12 acronym applet_bdo
27 iframe

What's hot (20)

PPTX
Squeeze Maximum Performance From Your Joomla Website
PPTX
Building fast aspnet websites
PPTX
[SoftServe IT Academy] - JavaScript Storages
PPT
Presentation
PPTX
Lazy load Website Assets
PDF
Introduction to web development
PPTX
JavaServer Pages
PDF
Campusdiaries Showcase - Raj Chourasia
PPT
wwwhisper Tool Review
KEY
The World of Dynamic Sites
PDF
SEO For WooCommerce
PPTX
Implementing a Responsive Image Strategy
PPTX
iBELONGmember and iACCOMPLISHpartner 2014
PPTX
Time is the enemy
PPTX
Portfolio Website
PDF
Hello, Canvas.
PDF
SEMCON 2013 - WordPress Optimization
PDF
21 Ways to Make WordPress Fast
PPTX
Java script tutorial
PPTX
My Portfolio Website
Squeeze Maximum Performance From Your Joomla Website
Building fast aspnet websites
[SoftServe IT Academy] - JavaScript Storages
Presentation
Lazy load Website Assets
Introduction to web development
JavaServer Pages
Campusdiaries Showcase - Raj Chourasia
wwwhisper Tool Review
The World of Dynamic Sites
SEO For WooCommerce
Implementing a Responsive Image Strategy
iBELONGmember and iACCOMPLISHpartner 2014
Time is the enemy
Portfolio Website
Hello, Canvas.
SEMCON 2013 - WordPress Optimization
21 Ways to Make WordPress Fast
Java script tutorial
My Portfolio Website
Ad

Similar to Get and post,session and cookie (20)

PPTX
Session and cookies,get and post
PPTX
Session,cookies and get and post methods
PPT
Session and cookies,get and post methods
PPTX
Cookies authentication
PPTX
C# cookieless session id and application state
PPTX
NZYP Project Casestudy using SilverStripe CMS
PPTX
Session and cookies ,get and post methods
PPTX
19_JavaScript - Storage_Cookies_students.pptx
PPTX
Advance java session 7
PPTX
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
KEY
Authentication
PDF
MySQL Security and Standardization at PayPal - Percona Live 2019
PPTX
Logging-In with Bitcoin - Paywalls without Emails
PPT
PPTX
PPT
PDF
Lt local storage
PDF
12 GoMeasure (sg and kl) - page speed light speed path to conversions - joh...
PDF
Startup Institute NY (Summer 2016) - Authentication, Validation, and Basic Te...
Session and cookies,get and post
Session,cookies and get and post methods
Session and cookies,get and post methods
Cookies authentication
C# cookieless session id and application state
NZYP Project Casestudy using SilverStripe CMS
Session and cookies ,get and post methods
19_JavaScript - Storage_Cookies_students.pptx
Advance java session 7
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
Authentication
MySQL Security and Standardization at PayPal - Percona Live 2019
Logging-In with Bitcoin - Paywalls without Emails
Lt local storage
12 GoMeasure (sg and kl) - page speed light speed path to conversions - joh...
Startup Institute NY (Summer 2016) - Authentication, Validation, and Basic Te...
Ad

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Architecture types and enterprise applications.pdf
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
Tartificialntelligence_presentation.pptx
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
STKI Israel Market Study 2025 version august
PDF
project resource management chapter-09.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Group 1 Presentation -Planning and Decision Making .pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
A comparative study of natural language inference in Swahili using monolingua...
1 - Historical Antecedents, Social Consideration.pdf
A novel scalable deep ensemble learning framework for big data classification...
Architecture types and enterprise applications.pdf
observCloud-Native Containerability and monitoring.pptx
Hindi spoken digit analysis for native and non-native speakers
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Module 1.ppt Iot fundamentals and Architecture
Tartificialntelligence_presentation.pptx
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
STKI Israel Market Study 2025 version august
project resource management chapter-09.pdf
1. Introduction to Computer Programming.pptx
TLE Review Electricity (Electricity).pptx
O2C Customer Invoices to Receipt V15A.pptx

Get and post,session and cookie

  • 3. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 4. GET & POST • 2 methods • Form data sent from client to server
  • 6. GET method • The data send along the query string <form action=“registration.php” method=“get”> • $_GET function is used to collect values in a form with method=“get". • Can seen in the url • Can be bookmarked • Not suitable for sending password or sensitive data • Cant send values exceeding 2000 characters
  • 8. POST method • $_POST function is used to collect values in a form with method="post". <form action=“registration” method=“post”> • Invisible in url • Cant be bookmarked • Suitable for sending sensitive data • 8 mb size by default
  • 9. GET & POST GET • Seen in url • Can be bookmarked • Not suitable for sending sensitive data • Max size=2000 characters POST • Invisible in url • Cant bookmarked • Suitable for sending sensitive data • Max size=8 mb
  • 10. Session &Cookie • Used to maintain the states of http request
  • 11. Session • A PHP session variable is used to store information about, or change settings for a user session. • Session variables hold information about one single user, and are available to all pages in one application.
  • 12. Session Starting php session Session_start() Storing a session variable $_SESSION['intUserId']=$arrUser['pk_int_user_id'];//set session variable Accessing a session variable $user_id=$_SESSION['intUserId']; Destroying a session variable 1. Unset($_SESSION[‘intUserId’]) 2. Session_destroy()
  • 13. Cookie • A cookie is often used to identify a user. • A cookie is a small file that the server embeds on the user's computer. • Each time the same computer requests a page with a browser, it will send the cookie too.
  • 14. Cookie Create cookie setcookie("intUserId",$intValue,time()+600);//create cookie variable Access cookie $intUserId=$_COOKIE['intUserId']; Unset cookie setcookie("intUserId", "", time()-600);//unset cookie
  • 15. Session &Cookie Session • Stored in server • Lost when browser close • Store string and object • Use future reference cookie • Stored in browser • Don’t lose when browser close • Only store string • Cant use
  • 17. Want to learn more about programming or Looking to become a good programmer? Are you wasting time on searching so many contents online? Do you want to learn things quickly? Tired of spending huge amount of money to become a Software professional? Do an online course @ baabtra.com We put industry standards to practice. Our structured, activity based courses are so designed to make a quick, good software professional out of anybody who holds a passion for coding.
  • 18. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Give a feedback @ massbaab.com/baabtra Thanks in advance www.baabtra.com | www.massbaab.com |www.baabte.com
  • 19. Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com Contact Us