Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
69982c62
authored
2014-02-22 10:37:14 +0800
by
asta.xie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
path default is /
httponly default true seuce default not set
1 parent
b405e19f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
context/output.go
context/output.go
View file @
69982c6
...
...
@@ -99,15 +99,19 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface
}
}
if
len
(
others
)
>
1
{
fmt
.
Fprintf
(
&
b
,
"; Path=%s"
,
sanitizeValue
(
others
[
1
]
.
(
string
)))
if
len
(
others
[
1
]
.
(
string
))
==
0
{
fmt
.
Fprintf
(
&
b
,
"; Path=%s"
,
'/'
)
}
else
{
fmt
.
Fprintf
(
&
b
,
"; Path=%s"
,
sanitizeValue
(
others
[
1
]
.
(
string
)))
}
}
if
len
(
others
)
>
2
{
if
len
(
others
)
>
2
&&
len
(
others
[
2
]
.
(
string
))
>
0
{
fmt
.
Fprintf
(
&
b
,
"; Domain=%s"
,
sanitizeValue
(
others
[
2
]
.
(
string
)))
}
if
len
(
others
)
>
3
{
if
len
(
others
)
>
3
&&
others
[
3
]
.
(
bool
)
{
fmt
.
Fprintf
(
&
b
,
"; Secure"
)
}
if
len
(
others
)
>
4
{
if
!
(
len
(
others
)
>
4
&&
others
[
4
]
.
(
bool
)
==
false
)
{
fmt
.
Fprintf
(
&
b
,
"; HttpOnly"
)
}
output
.
Context
.
ResponseWriter
.
Header
()
.
Add
(
"Set-Cookie"
,
b
.
String
())
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment