Click to See Complete Forum and Search --> : sessions


abhan
August 27th, 2001, 02:02 AM
i am developing an online store,wherein the shopping is possible only in few countries.once a user selects a country ,he can shop for only that country,upon selecting another country he should not have any recoooooords of the previous country,for example,if i have added item 1 in my cart for country1,and next if i select country 2,item 1 should not be present in my cart.
my code for this was

Language=VBScript


'Dim str,conn,rs,session

country = Request.Form("country") '
'Session("Country")=country
'if Session("country")"" then
''Session("country")=nothing
'set Session("country")=nothing
'Else
Session("Country")=country 'stores country value in Country
cun=Session("Country")


if (cun="") then
Response.Redirect("error.html")
Else


i had used the code commented above but it does not work.please suggest me what to do.
in brief i want to:
first check if the session value country is present or not ,if it is present ,i want to kill it and then again create the session value session and proceed with my code for further information.

pmmbala
September 11th, 2001, 01:26 AM
Hi friend,
This is ur Code:
- why the line 3 is needed.each time u assing the value to country.so the country var always contains value. then how can u kill the session vaue. i dont know its a prob.may be this also can be problem. other wise pls send ur the asp code. then i can try.. Thanks

1.country = Request.Form("country") '
3.'Session("Country")=country
4.'if Session("country")"" then
5.''Session("country")=nothing
6.'set Session("country")=nothing
7.'Else
8.Session("Country")=country 'stores country 9.value in Country
cun=Session("Country")


if (cun="") then
Response.Redirect("error.html")
Else


Bala
Prelude Solution Providers (P) Ltd.
Chennai.India

pmmbala_old
September 11th, 2001, 01:26 AM
Hi friend,
This is ur Code:
- why the line 3 is needed.each time u assing the value to country.so the country var always contains value. then how can u kill the session vaue. i dont know its a prob.may be this also can be problem. other wise pls send ur the asp code. then i can try.. Thanks

1.country = Request.Form("country") '
3.'Session("Country")=country
4.'if Session("country")"" then
5.''Session("country")=nothing
6.'set Session("country")=nothing
7.'Else
8.Session("Country")=country 'stores country 9.value in Country
cun=Session("Country")


if (cun="") then
Response.Redirect("error.html")
Else


Bala
Prelude Solution Providers (P) Ltd.
Chennai.India