Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것
by
한선용
,
이선 브라운
May 2021
Beginner to intermediate
448 pages
9h 47m
Korean
Hanbit Media, Inc.
Content preview from
한 권으로 끝내는 Node & Express(2판): 모던 웹을 위한 서버 사이드 자바스크립트의 모든 것
165
9
장
쿠키와 세션
secret
세션
ID
쿠키에 서명할 때 사용하는 키입니다.
cookie
-
parser
에서 사용하는 키와 같아도 됩
니다.
Key
고유한 세션 식별자를 저장할 쿠키의 이름입니다. 기본값은
connect
.
sid
입니다.
store
세션 저장소 인스턴스입니다. 기본값은
MemoryStore
의 인스턴스이며 지금은 이걸 써도 충분
합니다. 데이터베이스 저장소에 대해서는
13
장에서 알아봅니다.
cookie
세션 쿠키에 적용할 설정
(
path
,
domain
,
secure
등
)
입니다. 일반 쿠키의 기본값이 적용됩
니다.
9.4.2
세션 사용하기
일단 세션이 만들어지면 사용하기는 아주 쉽습니다. 요청 객체의
session
변수의 프로퍼티를
사용하면 됩니다.
req.session.userName = ‘Anonymous’
const colorScheme = req.session.colorScheme || ‘dark’
세션을 사용하면 요청 객체에서 값을 가져오고 응답 객체에서 값을 설정할 필요 없이, 전부 요
청 객체에서 처리합니다
(
응답 객체에는
session
프로퍼티가 없습니다
)
. 세션을 삭제할 때는
자바스크립트의
delete
연산자를 사용합니다.
req.session.userName = null // ‘userName’을 null로 설정하지만
// 제거하지는 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
한 권으로 끝내는 Node & Express: 웹사이트 구축을 위한 서버 사이드 자바스크립트
한성용, 이선 브라운
클라우드 네이티브를 위한 데이터 센터 네트워크 구축: 데이터 센터 네트워킹을 위한 아키텍처, 프로토콜, 도구
정기훈, 디네시 G. 더트
웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것
최용, 앤드루 호프먼
자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴
조너선 슈나이더
Publisher Resources
ISBN: 9791162244227