Forums
This topic is locked
Quick Session question.
Posted 15 Jan 2006 20:26:06
1
has voted
15 Jan 2006 20:26:06 Barry Smith posted:
<font face='Verdana'><font color=navy>Hi all,Info: DWMX - ASP VB
I am trying to build a site that requires a session control. I am new to sessions and I am trying to work out how to check if the session has been started.
My question is:
= ""
the same as
= Null
If I set my session variable to Null in order to reset it, does it make my variable = "" ?
Any advise most welcome.
Cheers,
</font id=navy></font id='Verdana'>
Barry Smith
BKS Graphic Design
| DWMX | ASP | VB | JS | MDB | SQL | SSL | CSS |
www.bksgd.co.uk
Replies
Replied 16 Jan 2006 01:49:51
16 Jan 2006 01:49:51 allan khalil replied:
Hi Barry,
This might not answer your question directly but I was also looking for the same thing... I came across a DW Extension created by Tom Muck (www.tom-muck.com) its called "remember me". Creates a cookie to validate the session with a check box to tick to remember the cookie values. Hope it helps... here is the source of the extension. As to your question if Null and "" is the same? Well he has used "" without any representation of the Null statement.
<%
If cstr(Request.Form("textfield")<>"" Then
If Request.form("checkbox" ="1" Then
Response.Cookies("myusername" = Request.Form("textfield"
Response.Cookies("mypassword" = Request.Form("textfield2"
Response.Cookies("rememberme" = "1"
Response.Cookies("myusername".expires = Date + 60
Response.Cookies("mypassword".expires = Date + 60
Response.Cookies("rememberme".expires = Date + 60
Else
<b>Response.Cookies("rememberme" = ""</b>
Response.Cookies("myusername" = ""
Response.Cookies("mypassword" = ""
End If
End If
%>
This might not answer your question directly but I was also looking for the same thing... I came across a DW Extension created by Tom Muck (www.tom-muck.com) its called "remember me". Creates a cookie to validate the session with a check box to tick to remember the cookie values. Hope it helps... here is the source of the extension. As to your question if Null and "" is the same? Well he has used "" without any representation of the Null statement.
<%
If cstr(Request.Form("textfield")<>"" Then
If Request.form("checkbox" ="1" Then
Response.Cookies("myusername" = Request.Form("textfield"
Response.Cookies("mypassword" = Request.Form("textfield2"
Response.Cookies("rememberme" = "1"
Response.Cookies("myusername".expires = Date + 60
Response.Cookies("mypassword".expires = Date + 60
Response.Cookies("rememberme".expires = Date + 60
Else
<b>Response.Cookies("rememberme" = ""</b>
Response.Cookies("myusername" = ""
Response.Cookies("mypassword" = ""
End If
End If
%>
Replied 16 Jan 2006 11:29:44
16 Jan 2006 11:29:44 Lee Diggins replied:
Hi Barry
Just to add to Allan's comments, NULL and "" are not the same.
"" is a zero length string
NULL is an unknown value
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Just to add to Allan's comments, NULL and "" are not the same.
"" is a zero length string
NULL is an unknown value
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>