468,512 Members | 1,561 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

shopping cart problem

347 100+
i have a shopping cart type of thing using session variables on my site, all has been working fine until today when someone copied the link of the page that views the cart and emailed it to us, i then realised that this will not work as the session variable is not in the page address, is there any way of adding a session variable to a page link aswell as sending it throught the variables?

i use thsi code on pages to add to session variable

Expand|Select|Wrap|Line Numbers
  1. <%
  3. if InStr(session("recordsInCart"), ","&request.form("recordNum")) = 0 then 
  4.    session("recordsInCart") = session("recordsInCart") + request.form("recordNum") &","
  5. else 
  6.    'do nothing
  7. end if 
  8. %>
i was wondering if i changed it so that i sent the session variable from the page in the link and then somehow used that link information to then make it a nes session variable on a new page?

i have attached some pages too
Attached Files
File Type: zip viewshortlist.zip (34.1 KB, 60 views)
Sep 19 '12 #1
1 1507
164 Expert 100+
Session variables themselves cannot be passed along; however, the data they store can be arbitrarily passed on. Two alternate ways to accomplish what you are trying to do is to:

(1) Save the list of cart items to a database table with a unique ID. The link to view the cart could then contain a querystring variable to passes the unique ID to a script which can query the database table for its relevant items;

or (2) all items are stored in querystring variables in the link.
Oct 27 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Josef Blösl | last post: by
3 posts views Thread by Randi | last post: by
1 post views Thread by Randi | last post: by
17 posts views Thread by Phil McKraken | last post: by
5 posts views Thread by =?Utf-8?B?Q2hpV2hpdGVTb3g=?= | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.