[WebDNA] Secure & HttpOnly Session Cookies

This WebDNA talk-list message is from

2013


It keeps the original formatting.
numero = 110793
interpreted = N
texte = --047d7bdca488d3e60104e7e0141b Content-Type: text/plain; charset=UTF-8 Dan / Stuart, As we're on a security thing at the moment, I was trying to work out how best to set session cookies. Here's what's working for me (WebDNA 6.2 on CentOS). - Tom On the 'login template' where the users username/password are checked: [!] ----------------------------------- ### Set session cookie and redirect to dashboard ### [/!][setcookie name=session-cookie&value=[url][url][encrypt seed=secret-seed][cart][/encrypt][/url][/url]&path=/&domain=[grep search=www&replace=][getmimeheader name=host][/grep]&secure=T][!] [/!][redirect /dashboard.tmpl?v=logon] On the 'dasboard template': [!] ------------------------------------ ### Reset session cookie with HttpOnly option ### [/!][showif [v]=logon][!] [/!][setmimeheader name=Set-Cookie&value=session-cookie=[url][url][getcookie name=session-cookie][/url][/url]; path=/; domain=[grep search=www&replace=][getmimeheader name=host][/grep]; secure; HttpOnly][!] [/!][/showif] On the 'logout template': [!] ------------------------------------ ### Clear session cookie ### [/!][setcookie name=session-cookie&value=&path=/&domain=[grep search=www&replace=][getmimeheader name=host][/grep]&expires=Thu, 01 Jan 1970 00:00:00 GMT] I can't get the [setmimeheader] working on the 'logon template'. It seems the full page has to load, maybe that's the way it's meant to be? --047d7bdca488d3e60104e7e0141b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dan / Stuart,

As we're on a securit= y thing at the moment, I was trying to work out how best to set session coo= kies. =C2=A0Here's what's working for me (WebDNA 6.2 on CentOS).

- Tom




On the 'login template' where the users username/pa= ssword are checked:


[!]


-----------------------------------
### =C2=A0Set session cookie and redirect = to dashboard =C2=A0###

[/!][setcookie name=3Dsession-cookie&value=3D[url][= url][encrypt seed=3Dsecret-seed][cart][/encrypt][/url][/url]&path=3D/&a= mp;domain=3D[grep search=3Dwww&replace=3D][getmimeheader name=3Dhost][/= grep]&secure=3DT][!]
[/!][redirect /dashboard.tmpl?v=3Dlogon]



On the 'dasboard template':

[!]


----------------------------= --------
### =C2=A0Reset ses= sion cookie with HttpOnly option =C2=A0###

[/!][sh= owif [v]=3Dlogon][!]
= [/!][setmimeheader name=3DSet-Cookie&value=3Dsession-cookie=3D[u= rl][url][getcookie name=3Dsession-cookie][/url][/url]; path=3D/; domain=3D[= grep search=3Dwww&replace=3D][getmimeheader name=3Dhost][/grep]; secure= ; HttpOnly][!]
[/!][/showif]



=
On the 'logout template':

[!]


------------------------------------
### =C2=A0Clear ses= sion cookie =C2=A0###

[/!][setcookie name=3Dsessio= n-cookie&value=3D&path=3D/&domain=3D[grep search=3Dwww&repl= ace=3D][getmimeheader name=3Dhost][/grep]&expires=3DThu, 01 Jan 1970 00= :00:00 GMT]




I ca= n't get the [setmimeheader] working on the 'logon template'. = =C2=A0 It seems the full page has to load, maybe that's the way it'= s meant to be?
--047d7bdca488d3e60104e7e0141b-- Associated Messages, from the most recent to the oldest:

    
--047d7bdca488d3e60104e7e0141b Content-Type: text/plain; charset=UTF-8 Dan / Stuart, As we're on a security thing at the moment, I was trying to work out how best to set session cookies. Here's what's working for me (WebDNA 6.2 on CentOS). - Tom On the 'login template' where the users username/password are checked: [!] ----------------------------------- ### Set session cookie and redirect to dashboard ### [/!][setcookie name=session-cookie&value=[url][url][encrypt seed=secret-seed][cart][/encrypt][/url][/url]&path=/&domain=[grep search=www&replace=][getmimeheader name=host][/grep]&secure=T][!] [/!][redirect /dashboard.tmpl?v=logon] On the 'dasboard template': [!] ------------------------------------ ### Reset session cookie with HttpOnly option ### [/!][showif [v]=logon][!] [/!][setmimeheader name=Set-Cookie&value=session-cookie=[url][url][getcookie name=session-cookie][/url][/url]; path=/; domain=[grep search=www&replace=][getmimeheader name=host][/grep]; secure; HttpOnly][!] [/!][/showif] On the 'logout template': [!] ------------------------------------ ### Clear session cookie ### [/!][setcookie name=session-cookie&value=&path=/&domain=[grep search=www&replace=][getmimeheader name=host][/grep]&expires=Thu, 01 Jan 1970 00:00:00 GMT] I can't get the [setmimeheader] working on the 'logon template'. It seems the full page has to load, maybe that's the way it's meant to be? --047d7bdca488d3e60104e7e0141b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dan / Stuart,

As we're on a securit= y thing at the moment, I was trying to work out how best to set session coo= kies. =C2=A0Here's what's working for me (WebDNA 6.2 on CentOS).

- Tom




On the 'login template' where the users username/pa= ssword are checked:


[!]


-----------------------------------
### =C2=A0Set session cookie and redirect = to dashboard =C2=A0###

[/!][setcookie name=3Dsession-cookie&value=3D[url][= url][encrypt seed=3Dsecret-seed][cart][/encrypt][/url][/url]&path=3D/&a= mp;domain=3D[grep search=3Dwww&replace=3D][getmimeheader name=3Dhost][/= grep]&secure=3DT][!]
[/!][redirect /dashboard.tmpl?v=3Dlogon]



On the 'dasboard template':

[!]


----------------------------= --------
### =C2=A0Reset ses= sion cookie with HttpOnly option =C2=A0###

[/!][sh= owif [v]=3Dlogon][!]
= [/!][setmimeheader name=3DSet-Cookie&value=3Dsession-cookie=3D[u= rl][url][getcookie name=3Dsession-cookie][/url][/url]; path=3D/; domain=3D[= grep search=3Dwww&replace=3D][getmimeheader name=3Dhost][/grep]; secure= ; HttpOnly][!]
[/!][/showif]



=
On the 'logout template':

[!]


------------------------------------
### =C2=A0Clear ses= sion cookie =C2=A0###

[/!][setcookie name=3Dsessio= n-cookie&value=3D&path=3D/&domain=3D[grep search=3Dwww&repl= ace=3D][getmimeheader name=3Dhost][/grep]&expires=3DThu, 01 Jan 1970 00= :00:00 GMT]




I ca= n't get the [setmimeheader] working on the 'logon template'. = =C2=A0 It seems the full page has to load, maybe that's the way it'= s meant to be?
--047d7bdca488d3e60104e7e0141b-- Tom Duke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

en/decrypt problem (1999) categories (1997) Help name our technology! (1997) Alphonse MacDonald/DC/IPSW is out of the office. (2003) Cart questions (1997) How many Databases can I open? (2003) Hard carriage convertion? (1998) Using ticks (2000) Multiple Pulldowns/Gary (1997) Shiping problem (1999) Can WC remember people? (1998) Bug or syntax error on my part? (1997) Formatting of email on NT (1998) Error Lob.db records error message not name (1997) Websited Development (1999) Most Efficiant Way to do restricted Areas (1997) 2nd WebCatalog2 Feature Request (1996) RE: Upload (1998) Word search (1997) WCS Newbie question (1997)