Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove information from session

Status
Not open for further replies.

Scotty2001

Technical User
Jul 7, 2001
3
US
I've been trying to get this to work, and it WON'T! I have a Global.asa file that sets up a session("ItemNumber") = ItemNo & session("ItemQty") = ItemQty . Other ASP pages add information to these two (Item Numbers are added into ItemNumber and they're quantity's are added into ItemQty.). But I need some VBScript code that can completely erase an ItemNumber & the ItemQty's from the session so they will no longer appear in the user's cart. If you could please help me I would greatly appreciate it!

Thanks!
 
Thanks foxbox, but exactly how do i use session.abandon? I don't want to abandon the entire session, just the session("ItemNumber(ItemNo)"). How do I put session.abandon in with that?
 
session.abandon clears all. what's wrong with:
session("ItemNumber")="" ? br
Gerard
 
It would have to be something like
session("ItemNumber")="ProductNumber".abandon because when a user adds an item to the cart it adds the product number to the itemnumber string, and I only want to delete the specific product number in the string, not the entire string.

Thanks,
Scott
 
Oke maybe this idea works for you:

' 1 2 3 4 5
cItemNo ="1234500001987651122355555"

'Now you want to delete ItemNo 4 (11223):

nNoOfItems = 5
nDelete = 4
cItemNo = left(cItemNo, (nDelete-1)*5) &_
right(cItemNo,(nNoOfItems-nDelete)*5)

br
Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top