Cookies instead of session variables!

Author Topic
LiToZ LiToZ
Freaking Member

Joined: 24 Dec 2001
Homepage: link
Country: Egypt
Posts: 65

Posted: 21 May 2002 03:53:37

Well, i have made a login page with Ultradev, but it stores the login info as a session variable!! how can i change that and make the login information stored as a cookie ?

Well, i have made a login page with Ultradev, but it stores the login info as a session variable!! how can i change that and make the login information stored as a cookie ?
Viktor Farcic
Zone Manager

Joined: 03 Apr 2001
Homepage: link
Country: Spain
Posts: 607

Posted: 21 May 2002 09:20:49

Find this code and change every SESSION to COOKIES.

Session("MM_Username" = MM_valUsername
If (MM_fldUserAuthorization <> "" Then
Session("MM_UserAuthorization" = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization" = ""
End If


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Well, i have made a login page with Ultradev, but it stores the login info as a session variable!! how can i change that and make the login information stored as a cookie ?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager

Find this code and change every SESSION to COOKIES.

Session("MM_Username" = MM_valUsername
If (MM_fldUserAuthorization &lt;&gt; "" Then
Session("MM_UserAuthorization" = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization" = ""
End If


<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Well, i have made a login page with Ultradev, but it stores the login info as a session variable!! how can i change that and make the login information stored as a cookie ?
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager
LiToZ LiToZ
Freaking Member

Joined: 24 Dec 2001
Homepage: link
Country: Egypt
Posts: 65

Posted: 21 May 2002 20:13:17

i found the code and made it :
' username and password match - this is a valid user
Cookies("MM_Username" = MM_valUsername
If (MM_fldUserAuthorization &lt;&gt; "" Then
Cookies("MM_UserAuthorization" = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Cookies("MM_UserAuthorization" = ""
End If



But i got the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Cookies'
/AllLogin.asp, line 34


so what can i do ? and also can u advice me and tell me is the session variable better or the cookies?

i found the code and made it :
' username and password match - this is a valid user
Cookies("MM_Username" = MM_valUsername
If (MM_fldUserAuthorization &lt;&gt; "" Then
Cookies("MM_UserAuthorization" = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Cookies("MM_UserAuthorization" = ""
End If



But i got the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Cookies'
/AllLogin.asp, line 34


so what can i do ? and also can u advice me and tell me is the session variable better or the cookies?
Bobby Jenkins
Member

Joined: 31 Aug 2001
Country: USA
Posts: 26

Posted: 18 Jun 2002 18:52:55

You will need to add the Response function in front of the word Cookies.

For example <pre id=code><font face=courier size=2 id=code>Response.Cookies("User"=MM_valUsername</font id=code></pre id=code>

That should work for you.

Bobby

I'm Beginning to See the Light

You will need to add the Response function in front of the word Cookies.

For example <pre id=code><font face=courier size=2 id=code>Response.Cookies("User"=MM_valUsername</font id=code></pre id=code>

That should work for you.

Bobby

I'm Beginning to See the Light
Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency