SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
Sessions and Cookies
Sessions and Cookies
Vi l P i
Vi l P i
Visual Programming
CS 783
Asim Israr
Visual Programming
CS 783
Asim Israr
Asim Israr
Asim Israr
What is Session?
A session is defined as the period of time
that a unique user interacts with a web
that a unique user interacts with a web
application.
Session state
Session state
• Programmatically, session state is
nothing more than memory in the
shape of a dictionary or hash table,
e.g. key-value pairs, which can be set
and read for the duration of a user's
session
ASP Session State
ASP Session State
• ASP maintains session state by
providing the client with a unique key
assigned to the user when the
session begins
• This key is stored in an HTTP cookie
y
that the client sends to the server on
each request.
q
• The server can then read the key
from the cookie and re-inflate the
from the cookie and re inflate the
server session state.
ASP Session State
P bl
Problems
• Process dependent
– ASP session state exists in the process that
hosts ASP
S f li it ti
• Server farm limitations
– ASP session state is machine specific. Each
ASP server provides its own session state and
ASP server provides its own session state, and
unless the user returns to the same server, the
session state is inaccessible
• Cookie dependent
– Clients that don't accept HTTP cookies can't
take advantage of session state
take advantage of session state
ASP.NET session state solves all of the
above problems associated with classic
ASP session state
• Process independent
p
– ASP.NET session state is able to run in a separate
process from the ASP.NET host process
• Support for server farm configurations
– By moving to an out-of-process model, ASP.NET
also solves the server farm problem
also solves the server farm problem
• Cookie independent
Cookieless session state support through simple
– Cookieless session state support through simple
configurations
Session Configurations
Session Configurations
fi i
<configuration>
<sessionstate
mode="inproc"
cookieless="false"
cookieless= false
timeout="20"
sqlconnectionstring="data
source=127 0 0 1;user id=<user
source 127.0.0.1;user id <user
id>;password=<password>"
server="127.0.0.1"
port="42424" />
p
</configuration>
Session Configurations
Session Configurations
• Mode. The mode setting supports
three options: inproc, sqlserver, and
stateserver. ASP.NET supports two
modes: in process and out of
process. There are also two options
for out-of-process state management:
memory based (stateserver), and
SQL Server based (sqlserver).
Session Configurations
Session Configurations
• Cookieless. The cookieless option for
ASP.NET is configured with simple
Boolean setting.
• Timeout. This option controls the
length of time a session is considered
g
valid. The session timeout is a sliding
value; on each request the timeout
q
period is set to the current time plus
the timeout value
Session Configurations
Session Configurations
• Sqlconnectionstring. The
sqlconnectionstring identifies the
database connection string that
names the database used for mode
sqlserver.
• Server. In the out-of-process mode
stateserver, it names the server that
is running the required Windows NT
service: ASPState.
Session Configurations
Session Configurations
• Port. The port setting, which
accompanies the server setting,
identifies the port number that
corresponds to the server setting for
mode stateserver.
Performance and Reliability
Considerations
• In process
In process
– In process will perform best because the
session state memory is kept within the
y p
ASP.NET process.
– For Web applications hosted on a single
pp g
server, applications in which the user is
guaranteed to be re-directed to the
h i
correct server, or when session state
data is not critical, this is the mode to
choose
choose.
Performance and Reliability
Considerations
• Out of process
Out of process
– This mode is best used when
performance is important but you can't
p p y
guarantee which server a user will
request an application from.
– With out-of-process mode, you get the
performance of reading from memory
d h li bili f
and the reliability of a separate process
that manages the state for all servers.
Performance and Reliability
Considerations
• SQL Server
SQL Server
– This mode is best used when the
reliability of the data is fundamental to
y
the stability of the application, as the
database can be clustered for failure
scenarios.
– The performance isn't as fast as out of
b h d ff i h hi h
process, but the tradeoff is the higher
level of reliability.
What is Cookie?
A cookie is a small bit of text that accompanies
requests and pages as they go between the
q p g y g
web server and browser.
Contains information the web application can
read whenever the user visits the site
Background
Background
• For example, if a user requests a
page from your site and your
application sends not just a page, but
also a cookie containing the date and
time, when the user's browser gets
the page, the browser also gets the
cookie, which it stores in a folder on
the user's hard disk.
Background
Background
• Later, if user requests a page from
your site again, when the user enters
the URL the browser looks on the
local hard disk for a cookie
associated with the URL.
• If the cookie exists, the browser
sends the cookie to your site along
y g
with the page request.
Background
Background
• Your application can then determine
the date and time that the user last
visited the site.
• You might use the information to
display a message to the user or
p y g
check an expiration date.
Background
Background
• Cookies are associated with a Web
site, not with a specific page, so the
browser and server will exchange
cookie information no matter what
page the user requests from your
site.
• As the user visits different sites, each
site might send a cookie to the user's
browser as well; the browser stores
all the cookies separately.
Usage
Usage
• Cookies are used for many purposes,
all relating to helping the Web site
remember users
• For example, a site conducting a poll
might use a cookie simply as a
g p y
Boolean value to indicate whether a
user's browser has already
y
participated in voting so that the user
cannot vote twice.
Usage
Usage
• A site that asks a user to log on might
use a cookie to record that the user
already logged on so that the user
does not have to keep entering
credentials.
Limitations
Limitations
• Most browsers support cookies of up
to 4096 bytes.
– Because of this small limit, cookies are
best used to store small amounts of
data
• Browsers also impose limitations on
how many cookies your site can store
on the user's computer
• Users can set their browser to refuse
cookies

Weitere ähnliche Inhalte

Ähnlich wie Session and Cookies.pdf

IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database ConnectivityIT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivitypkaviya
 
Session,Cookies and Authentication
Session,Cookies and AuthenticationSession,Cookies and Authentication
Session,Cookies and AuthenticationKnoldus Inc.
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702Jess Coburn
 
Enterprise java unit-2_chapter-2
Enterprise  java unit-2_chapter-2Enterprise  java unit-2_chapter-2
Enterprise java unit-2_chapter-2sandeep54552
 
SPSUtah 2014 SharePoint 2013 Performance (Admin)
SPSUtah 2014 SharePoint 2013 Performance (Admin)SPSUtah 2014 SharePoint 2013 Performance (Admin)
SPSUtah 2014 SharePoint 2013 Performance (Admin)Brian Culver
 
Session and state management
Session and state managementSession and state management
Session and state managementPaneliya Prince
 
SQL Server Lift & Shift on Azure - SQL Saturday 921
SQL Server Lift & Shift on Azure - SQL Saturday 921SQL Server Lift & Shift on Azure - SQL Saturday 921
SQL Server Lift & Shift on Azure - SQL Saturday 921Marco Obinu
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
 
Module-5_WTA_Managing State & jQuery
Module-5_WTA_Managing State & jQueryModule-5_WTA_Managing State & jQuery
Module-5_WTA_Managing State & jQuerySIVAKUMAR V
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessionsNuha Noor
 
Sitecore User Group: Session State and Sitecore xDB
Sitecore User Group: Session State and Sitecore xDB Sitecore User Group: Session State and Sitecore xDB
Sitecore User Group: Session State and Sitecore xDB nonlinear creations
 
Lesson 1 configuring
Lesson 1   configuringLesson 1   configuring
Lesson 1 configuringRam Kedem
 

Ähnlich wie Session and Cookies.pdf (20)

State management in ASP .NET
State  management in ASP .NETState  management in ASP .NET
State management in ASP .NET
 
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database ConnectivityIT2255 Web Essentials - Unit V Servlets and Database Connectivity
IT2255 Web Essentials - Unit V Servlets and Database Connectivity
 
Session,Cookies and Authentication
Session,Cookies and AuthenticationSession,Cookies and Authentication
Session,Cookies and Authentication
 
Session and Cookies
Session and CookiesSession and Cookies
Session and Cookies
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702
 
PHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and SessionsPHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and Sessions
 
Client&server side scripting
Client&server side scriptingClient&server side scripting
Client&server side scripting
 
Enterprise java unit-2_chapter-2
Enterprise  java unit-2_chapter-2Enterprise  java unit-2_chapter-2
Enterprise java unit-2_chapter-2
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
 
SPSUtah 2014 SharePoint 2013 Performance (Admin)
SPSUtah 2014 SharePoint 2013 Performance (Admin)SPSUtah 2014 SharePoint 2013 Performance (Admin)
SPSUtah 2014 SharePoint 2013 Performance (Admin)
 
Session and state management
Session and state managementSession and state management
Session and state management
 
SQL Server Lift & Shift on Azure - SQL Saturday 921
SQL Server Lift & Shift on Azure - SQL Saturday 921SQL Server Lift & Shift on Azure - SQL Saturday 921
SQL Server Lift & Shift on Azure - SQL Saturday 921
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Module-5_WTA_Managing State & jQuery
Module-5_WTA_Managing State & jQueryModule-5_WTA_Managing State & jQuery
Module-5_WTA_Managing State & jQuery
 
Advance Java
Advance JavaAdvance Java
Advance Java
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessions
 
Sitecore User Group: Session State and Sitecore xDB
Sitecore User Group: Session State and Sitecore xDB Sitecore User Group: Session State and Sitecore xDB
Sitecore User Group: Session State and Sitecore xDB
 
Session State and Sitecore xDB
Session State and Sitecore xDBSession State and Sitecore xDB
Session State and Sitecore xDB
 
Lesson 1 configuring
Lesson 1   configuringLesson 1   configuring
Lesson 1 configuring
 

Kürzlich hochgeladen

Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...
Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...
Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...Monika Rani
 
Call Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdf
Call Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdfCall Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdf
Call Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdfsoniya singh
 
AMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALA
AMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALAAMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALA
AMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALASapna Call girl
 
Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...
Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...
Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...Monika Rani
 
💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...
💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...
💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...Sheetaleventcompany
 
Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...Apsara Of India
 
Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...
Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...
Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...Sheetaleventcompany
 
Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...
Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...
Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...rajveerescorts2022
 
Unnao 💋 Call Girl 97487*63073 Call Girls in unnao Escort service book now
Unnao 💋  Call Girl 97487*63073 Call Girls in unnao Escort service book nowUnnao 💋  Call Girl 97487*63073 Call Girls in unnao Escort service book now
Unnao 💋 Call Girl 97487*63073 Call Girls in unnao Escort service book nowapshanarani255
 
9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Servicenishacall1
 
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...Sheetaleventcompany
 
Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...Apsara Of India
 
KANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNUR
KANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNURKANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNUR
KANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNURSapna Call girl
 
Sri Ganganagar 💋 Call Girl 9748763073 Call Girls Escort service Ganganagar b...
Sri Ganganagar 💋 Call Girl 9748763073 Call Girls  Escort service Ganganagar b...Sri Ganganagar 💋 Call Girl 9748763073 Call Girls  Escort service Ganganagar b...
Sri Ganganagar 💋 Call Girl 9748763073 Call Girls Escort service Ganganagar b...apshanarani255
 
AGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
AGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEAGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
AGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEayushi9330
 
Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...
Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...
Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...Apsara Of India
 
Budaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for Friendship
Budaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for FriendshipBudaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for Friendship
Budaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for FriendshipNitya salvi
 
💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...
💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...
💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...Cara Menggugurkan Kandungan 087776558899
 
Call Girls Pune Call WhatsApp 7870993772 Top Class Call Girl Service Availab...
Call Girls Pune Call  WhatsApp 7870993772 Top Class Call Girl Service Availab...Call Girls Pune Call  WhatsApp 7870993772 Top Class Call Girl Service Availab...
Call Girls Pune Call WhatsApp 7870993772 Top Class Call Girl Service Availab...Monika Rani
 
Rehabilitation centres in zimbabwe | 📲 +263788080001
Rehabilitation centres in zimbabwe |  📲 +263788080001Rehabilitation centres in zimbabwe |  📲 +263788080001
Rehabilitation centres in zimbabwe | 📲 +263788080001Rehabilitation Centre
 

Kürzlich hochgeladen (20)

Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...
Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...
Call Girls Siliguri Just Call 7870993772 Top Class Call Girl Service Availabl...
 
Call Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdf
Call Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdfCall Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdf
Call Now ☎8264348440|| Call Girls in Mehrauli Escort Service Delhi N.C.R..pdf
 
AMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALA
AMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALAAMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALA
AMBALA CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE AMBALA
 
Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...
Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...
Call Girls Nagpur 💋Just Call WhatsApp 7870993772 Top Class Call Girl Service ...
 
💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...
💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...
💚Amritsar Call Girl 💯Jiya 📲🔝8725944379🔝Call Girls In Amritsar No💰Advance Cash...
 
Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Just Genuine Call Girl in Udaipur Escort Ser...
 
Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...
Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...
Call Girls In Chandigarh ☎ 08868886958✅ Just Genuine Call Call Girls Chandiga...
 
Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...
Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...
Chandigarh Call Girls ☎ 9878799926✅ Just Genuine Call Call Girls Mohali 🧿Elit...
 
Unnao 💋 Call Girl 97487*63073 Call Girls in unnao Escort service book now
Unnao 💋  Call Girl 97487*63073 Call Girls in unnao Escort service book nowUnnao 💋  Call Girl 97487*63073 Call Girls in unnao Escort service book now
Unnao 💋 Call Girl 97487*63073 Call Girls in unnao Escort service book now
 
9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 51 (Delhi) Call Girl Service
 
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
👉 Amritsar Call Girls 👉📞 8725944379 👉📞 Just📲 Call Ruhi Call Girl Near Me Amri...
 
Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...
Udaipur Call Girls ☎ 9602870969✅ Best Genuine Call Girl in Udaipur Escort Ser...
 
KANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNUR
KANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNURKANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNUR
KANNUR CALL GIRL 9661985112 LOW PRICE ESCORT SERVICE KANNUR
 
Sri Ganganagar 💋 Call Girl 9748763073 Call Girls Escort service Ganganagar b...
Sri Ganganagar 💋 Call Girl 9748763073 Call Girls  Escort service Ganganagar b...Sri Ganganagar 💋 Call Girl 9748763073 Call Girls  Escort service Ganganagar b...
Sri Ganganagar 💋 Call Girl 9748763073 Call Girls Escort service Ganganagar b...
 
AGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
AGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEAGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
AGARTALA CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...
Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...
Udaipur Call Girls ☎ 9602870969✅ Better Genuine Call Girl in Udaipur Escort S...
 
Budaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for Friendship
Budaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for FriendshipBudaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for Friendship
Budaun Call Girl WhatsApp Chat: 📞 8617370543 | Girls Number for Friendship
 
💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...
💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...
💊💊 OBAT PENGGUGUR KANDUNGAN JAMBI 08776558899 ATAU CARA GUGURKAN JANIN KLINIK...
 
Call Girls Pune Call WhatsApp 7870993772 Top Class Call Girl Service Availab...
Call Girls Pune Call  WhatsApp 7870993772 Top Class Call Girl Service Availab...Call Girls Pune Call  WhatsApp 7870993772 Top Class Call Girl Service Availab...
Call Girls Pune Call WhatsApp 7870993772 Top Class Call Girl Service Availab...
 
Rehabilitation centres in zimbabwe | 📲 +263788080001
Rehabilitation centres in zimbabwe |  📲 +263788080001Rehabilitation centres in zimbabwe |  📲 +263788080001
Rehabilitation centres in zimbabwe | 📲 +263788080001
 

Session and Cookies.pdf

  • 1. Sessions and Cookies Sessions and Cookies Vi l P i Vi l P i Visual Programming CS 783 Asim Israr Visual Programming CS 783 Asim Israr Asim Israr Asim Israr
  • 2. What is Session? A session is defined as the period of time that a unique user interacts with a web that a unique user interacts with a web application.
  • 3. Session state Session state • Programmatically, session state is nothing more than memory in the shape of a dictionary or hash table, e.g. key-value pairs, which can be set and read for the duration of a user's session
  • 4. ASP Session State ASP Session State • ASP maintains session state by providing the client with a unique key assigned to the user when the session begins • This key is stored in an HTTP cookie y that the client sends to the server on each request. q • The server can then read the key from the cookie and re-inflate the from the cookie and re inflate the server session state.
  • 5. ASP Session State P bl Problems • Process dependent – ASP session state exists in the process that hosts ASP S f li it ti • Server farm limitations – ASP session state is machine specific. Each ASP server provides its own session state and ASP server provides its own session state, and unless the user returns to the same server, the session state is inaccessible • Cookie dependent – Clients that don't accept HTTP cookies can't take advantage of session state take advantage of session state
  • 6. ASP.NET session state solves all of the above problems associated with classic ASP session state • Process independent p – ASP.NET session state is able to run in a separate process from the ASP.NET host process • Support for server farm configurations – By moving to an out-of-process model, ASP.NET also solves the server farm problem also solves the server farm problem • Cookie independent Cookieless session state support through simple – Cookieless session state support through simple configurations
  • 7. Session Configurations Session Configurations fi i <configuration> <sessionstate mode="inproc" cookieless="false" cookieless= false timeout="20" sqlconnectionstring="data source=127 0 0 1;user id=<user source 127.0.0.1;user id <user id>;password=<password>" server="127.0.0.1" port="42424" /> p </configuration>
  • 8. Session Configurations Session Configurations • Mode. The mode setting supports three options: inproc, sqlserver, and stateserver. ASP.NET supports two modes: in process and out of process. There are also two options for out-of-process state management: memory based (stateserver), and SQL Server based (sqlserver).
  • 9. Session Configurations Session Configurations • Cookieless. The cookieless option for ASP.NET is configured with simple Boolean setting. • Timeout. This option controls the length of time a session is considered g valid. The session timeout is a sliding value; on each request the timeout q period is set to the current time plus the timeout value
  • 10. Session Configurations Session Configurations • Sqlconnectionstring. The sqlconnectionstring identifies the database connection string that names the database used for mode sqlserver. • Server. In the out-of-process mode stateserver, it names the server that is running the required Windows NT service: ASPState.
  • 11. Session Configurations Session Configurations • Port. The port setting, which accompanies the server setting, identifies the port number that corresponds to the server setting for mode stateserver.
  • 12. Performance and Reliability Considerations • In process In process – In process will perform best because the session state memory is kept within the y p ASP.NET process. – For Web applications hosted on a single pp g server, applications in which the user is guaranteed to be re-directed to the h i correct server, or when session state data is not critical, this is the mode to choose choose.
  • 13. Performance and Reliability Considerations • Out of process Out of process – This mode is best used when performance is important but you can't p p y guarantee which server a user will request an application from. – With out-of-process mode, you get the performance of reading from memory d h li bili f and the reliability of a separate process that manages the state for all servers.
  • 14. Performance and Reliability Considerations • SQL Server SQL Server – This mode is best used when the reliability of the data is fundamental to y the stability of the application, as the database can be clustered for failure scenarios. – The performance isn't as fast as out of b h d ff i h hi h process, but the tradeoff is the higher level of reliability.
  • 15. What is Cookie? A cookie is a small bit of text that accompanies requests and pages as they go between the q p g y g web server and browser. Contains information the web application can read whenever the user visits the site
  • 16. Background Background • For example, if a user requests a page from your site and your application sends not just a page, but also a cookie containing the date and time, when the user's browser gets the page, the browser also gets the cookie, which it stores in a folder on the user's hard disk.
  • 17. Background Background • Later, if user requests a page from your site again, when the user enters the URL the browser looks on the local hard disk for a cookie associated with the URL. • If the cookie exists, the browser sends the cookie to your site along y g with the page request.
  • 18. Background Background • Your application can then determine the date and time that the user last visited the site. • You might use the information to display a message to the user or p y g check an expiration date.
  • 19. Background Background • Cookies are associated with a Web site, not with a specific page, so the browser and server will exchange cookie information no matter what page the user requests from your site. • As the user visits different sites, each site might send a cookie to the user's browser as well; the browser stores all the cookies separately.
  • 20. Usage Usage • Cookies are used for many purposes, all relating to helping the Web site remember users • For example, a site conducting a poll might use a cookie simply as a g p y Boolean value to indicate whether a user's browser has already y participated in voting so that the user cannot vote twice.
  • 21. Usage Usage • A site that asks a user to log on might use a cookie to record that the user already logged on so that the user does not have to keep entering credentials.
  • 22. Limitations Limitations • Most browsers support cookies of up to 4096 bytes. – Because of this small limit, cookies are best used to store small amounts of data • Browsers also impose limitations on how many cookies your site can store on the user's computer • Users can set their browser to refuse cookies