File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 33// Shows all cookies stored in document.cookies in a console.table
44
55( function ( ) {
6- window . viewCookies = function ( ) {
7- var rawCookies = document . cookie . split ( ';' ) , cookies = [ ] ;
6+ window . viewCookies = function ( ) {
7+ var rawCookies = document . cookie . split ( ';' ) , cookies = [ ] ;
8+ rawCookies . forEach ( function ( cookie ) {
9+ var parsedCookie = cookie . split ( '=' ) , cookieData = { } ;
10+ cookies . push ( {
11+ 'key' : parsedCookie . shift ( ) ,
12+ 'value' : decodeURIComponent ( parsedCookie . join ( '=' ) )
13+ } ) ;
14+ } ) ;
15+ console . table ( cookies ) ;
16+ } ;
17+ } ) ( ) ;
818
9- rawCookies . forEach ( function ( cookie ) {
10- var parsedCookie = cookie . split ( '=' ) , cookieData = { } ;
11- cookies . push ( {
12- 'key' : parsedCookie . shift ( ) ,
13- 'value' : decodeURIComponent ( parsedCookie . join ( '=' ) )
14- } ) ;
15- } ) ;
16- console . table ( cookies ) ;
17- } ;
18- } ) ( ) ;
19+ window . viewCookies ( ) ;
You can’t perform that action at this time.
0 commit comments