Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - need help in cookie in storing userName
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

need help in cookie in storing userName

 Post Reply Post Reply
Author
thebmwz4 View Drop Down
Newbie
Newbie


Joined: 17 June 2005
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote thebmwz4 Quote  Post ReplyReply Direct Link To This Post Topic: need help in cookie in storing userName
    Posted: 14 September 2005 at 1:06am
hi all, i wrote a code to store the user's username as a cookie so as he need not key in his username in his next log in. but yet, my system is unable to record it as a cookie. can anyone help? thanks.
 
this is the code where i try retrieve his cookie username in his textbox for keying in his username

<input type="text" name="Name" size="20" maxlength="15" value="<%=Request.Cookies("Savelogin")%>" >

 

ths is the code for him to check the checkbox to save his username as a cookie

<input type="checkbox" name="Savelogin" >Save Login as a cookie?

Next, the form will be submitted to another page for processing
if (confirm('Press OK to proceed, otherwise Cancel to go back')){document.confirmUser.method = 'post';
document.confirmUser.action='loginConfirm.asp';
document.confirmUser.submit();}
 
 
this is the code in the next page"loginConfirm.asp"

<%

dim strEmail

if request.queryString("cookie")=1 then

strEmail=request.cookies("savelogin")("Name")

else

strEmail=request.form("name")

end if

'name of cookie is Savelogin
Dim cookieSaved
if request.form("Savelogin")="on" then
response.cookies("Savedlogin")("Name")=request.form("name")
response.cookies("Savedlogin").Expires=Date+3
cookieSaved=True
else
cookieSaved=False
end if
%>
 
 
 
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2005 at 6:27pm
Change
<input type="text" name="Name" size="20" maxlength="15" value="<%=Request.Cookies("Savelogin")%>" >
to
<input type="text" name="Name" size="20" maxlength="15" value="<%=Request.Cookies("Savelogin")("name")%>" >
Back to Top
thebmwz4 View Drop Down
Newbie
Newbie


Joined: 17 June 2005
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote thebmwz4 Quote  Post ReplyReply Direct Link To This Post Posted: 14 September 2005 at 7:53pm
hi ljamal! thanks! its works successfully. thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.