VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-Cart StoreFront Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Log In, Log Out
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

United Kingdom
17 Posts

Posted - February 13 2003 :  06:36:51  Show Profile  Reply with Quote
Hello Everybody,

I have been atempting to provide a more personal website for my visitors by having them log in if they are returning. Cam provided me with some code which I have changed to provide links and messages I would like printed. This sits in my shoppageheader.html template. Called via a routine called usercheck. The code is as follows:-
<%sub usercheck
'YourVirtualStore code
'Source Code modified
'From YourVirtualStore


If GetSess("Firstname")<>"" then
Response.Write "<font face ='verdana' size='1' color=' #46648C'><b>Welcome Back "
Response.Write Getsess("Firstname") & " " &Getsess("Lastname") & "<b></font>"
Response.Write "<a href='shopend.asp'>Log out</a>"
Response.Write "<font face ='verdana' size='1' color=' #46648C'>Returning Customers "
Response.Write "<a href='#' OnClick=window.open('shopcustadminlogin.asp','','width=550,"
Response.Write "height=400,menubar=no,toolbar=no,location=no,status=no"
Response.Write "directories=no,copyhistory=no,resizable=no,scrollbars=no')>Login Here</a>"

end if
'End YourVirtualStore code
end sub%>

I have also made some changes to the shopcustadmin.asp page that deals with logging in so that it now redirects to the main website page which calls it, this is as follows:-

<%Option explicit%>
<!--#include file="shop$db.asp"-->
<!--#include file="usercheck.asp"-->
' Customer Service Menu
' VP-ASP Version 4.50 May 13, 2002
' add more menus at the botom of this code
Dim menus(20), urls(20), menucount
Dim loginError, infomsg
Dim NumProc
dim LoginFlag
NumProc = 0
If GetSess("CustomerLoginCID")="" then
end if
SetSess "CurrentUrl","shopcustadmin.asp"
Checklogin loginflag
if sError<> "" then
response.write getconfig("xfont") & "<b>" & SError & "</b></font><br><br>"
end if
if Infomsg<> "" then
response.write getconfig("xfont") & "<b>" & Infomsg & "</b></font><br><br>"
end if


Sub Checklogin (loginflag)
If GetSess("Customerid")<>"" and Getsess("Lastname") <>"" then
If getsess("Customerlogincid")="" then
SetSess "CustomerLoginCID",Getsess("Customerid")
end if
end if
end sub

' Version 3.00
' Shopadmin.asp forces relogin
' shopadmin1.asp (this routine checks to see if you are already logdded in
'******** Display table
Sub AddMenu
dim i
For i = 0 to menucount
Formatrow Menus(i), urls(i)
end sub
Sub FormatHeader
Response.write "<center>" & Custadmintable
Response.write CustAdminHeaderRow
Response.write CustAdminHeaderFont & LangCustAdmin01 & CustAdminHeaderEnd
end sub
Sub FormatRow (name, url)
response.write CustAdminRow
Response.write CustAdminNumColumn & NumProc & "." & CustAdminNumEnd
Response.write CustAdminColumn & "<a href='" & url & "'>" & CustAdminFont & name & "</a>" & CustAdminColumnEnd
end sub
Sub FormatTrailer

end sub
Sub AddMenuItem (caption, url, flag)
If flag<>"Yes" then exit sub
end sub
Sub addnewUser
response.write ("<p><font size=1><a href=shopcustadminlogin.asp?new=yes>" & LangLogin02 & "</a></font></p>")
end sub

Sub SetUpMenus
' First field is the caption the customer sees
' Second is URL to go to
' Third is "Yes" (case sensitive) If Yes menu is displayed
AddMenuItem LangAdminLogin,"shopcustadminlogin.asp", LoginFlag
AddMenuItem LangSaveCartPrompt,"shopsavecart.asp", getconfig("xAllowSaveCart")
AddMenuItem LangCustAdminStatus,"shopstatus.asp", getconfig("xAllowReviewOrders")
AddMenuItem LangCouponDiscount,"shopcustadmincoupon.asp",getconfig("xAllowCoupons")
AddMenuItem LangGiftRedeem,"shopcustadmingift.asp", getconfig("xGiftCertificates")
AddMenuItem LangGiftBuy,"shopgift.asp", getconfig("xGiftCertificates")
AddmenuItem LangCustAdminDetails,"shopcustupdate.asp",getconfig("xAllowCustomerUpdates")
AddMenuItem LangLoginForgot,"shopmailpwd.asp", getconfig("xPassword")
AddMenuItem LangMaillistSubject,"shopcustregister.asp", getconfig("xAllowcustomerregister")
AddMenuItem LangCustAdminMailList,"shopmaillist.asp", getconfig("xAllowMailList")
AddMenuItem LangSupplierAdmin,"shopsupplierregister.asp", getconfig("xAllowSupplierRegister")
AddMenuItem LangGiftRegistry,"shopgiftregadmin.asp", getconfig("xgiftregistry")
AddMenuItem LangContactus,"shopcustcontact.asp", getconfig("xcontactform")
end sub

The intention is that the person visits the site and logs in, once logged in there name is displayed and a log out button. However getting the log out function to work is proving to be difficult because I have tried all sorts of suggestions to clear the sesion details and they don't seem to work. At the moment I am working from a PWS in order to develop the site, I am hoping to get the site up within the next week or so, I would like this feature to be implemented but unfortuantely I am at my wits end with trying. I am a beginner in the realms of ASP so any help would be appreciated.

Thanks All,


Lee Mulholland


Starting Member

7 Posts

Posted - February 26 2003 :  09:42:40  Show Profile  Reply with Quote

Instead of just shopend.asp use shopend.asp?end=1, This will logout your customer and clear the session variables.

However, you are using cookie login, so as soon as the customer is redirected to any page in your cart they are automatically logged back in.

Instead of using the auto cookie login you might try using the cookies to fill in the login form then have the customer submit the form by clicking a login button or link.

You could use the cookie to welcome back the customer and then ask if they would like to login.

Changes will need to be made to shopsess.asp so it does not automatically log your customer back in.

Hope this help you get started...


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000