473,385 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Session variables conflict

Hi,

Here's my problem. I'm working on a site where customers can buy
tickets for events. Let's take the example where in webform1.aspx, the
customer enter all its personal information. Then when he clicks a
button to register and go to the next step, i enter the personal
information in the database and redirect to let's say webform2.aspx.

Once in webform2, if the user go back to webform1 with his browser's
back button and clicks on the button in webform1 again, this will add
another record in the database.

To fix this problem i just added the new customer id in a Session
variable when the user registers for the first time. So if he goes
back then clicks on the button again, i will update his profile
instead of creating a new, duplicated record.

However in the admin part of the site, the administrator can create
multiple new registrations at the same time, in different browser
windows. Different windows yes, but still the same session! Which
means that the customer id stored in Session is being replaced.

I'm looking for a way to store the id without conflicts if there are
different windows open for the same session. Is there a way to
retrieve a unique id for each browser window? Ex:

Session[UniqueIdOfWindow.ToString() + "CustomerId"] = 5;
Or any other way to share a value between pages. Hidden fields or
query strings won't work, since this problem happens when the user
clicks on the back button of his browser, so there is no way to send
hidden fields values or parameters in the url. Any idea would be
appreciated. Thanks!

Matt
Nov 17 '05 #1
3 1911
Matt wrote:
Once in webform2, if the user go back to webform1 with his browser's
back button and clicks on the button in webform1 again, this will add
another record in the database.


Change the code to search for the given client record and update it if
found, insert it if not.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
Nov 17 '05 #2
Good idea, but won't work if the user go back to correct some
information. Ex: his name or phone number

If he corrects his phone number, and then i do a search using his
phone number, it won't find the record in the database, so i would
create a new record. Thanks for trying!
On Wed, 13 Aug 2003 18:06:41 -0500, "Frank Oquendo" <fr****@acadx.com>
wrote:
Matt wrote:
Once in webform2, if the user go back to webform1 with his browser's
back button and clicks on the button in webform1 again, this will add
another record in the database.


Change the code to search for the given client record and update it if
found, insert it if not.


Nov 17 '05 #3
What you need to do is determine what makes a user unique. Is it a Name,
Name / Phone number combination etc. If a combination of all fields make a
user unique, always insert a new record like you are doing. Whatever
happens at step two probably generates some databse entries. You can have a
process that runs daily / weekly that clears out users that "never made it
to step two"

OR

When the user clicks "register" on webform1, check to see if a user like
this exists yet. If it exists, update the user, grab the UserID, and move
on to step 2. If ti does not exists, create the user, grab the UserID, and
move to step two.

Michael

"Matt" <me***@rocks.com> wrote in message
news:ir********************************@4ax.com...
Hi,

Here's my problem. I'm working on a site where customers can buy
tickets for events. Let's take the example where in webform1.aspx, the
customer enter all its personal information. Then when he clicks a
button to register and go to the next step, i enter the personal
information in the database and redirect to let's say webform2.aspx.

Once in webform2, if the user go back to webform1 with his browser's
back button and clicks on the button in webform1 again, this will add
another record in the database.

To fix this problem i just added the new customer id in a Session
variable when the user registers for the first time. So if he goes
back then clicks on the button again, i will update his profile
instead of creating a new, duplicated record.

However in the admin part of the site, the administrator can create
multiple new registrations at the same time, in different browser
windows. Different windows yes, but still the same session! Which
means that the customer id stored in Session is being replaced.

I'm looking for a way to store the id without conflicts if there are
different windows open for the same session. Is there a way to
retrieve a unique id for each browser window? Ex:

Session[UniqueIdOfWindow.ToString() + "CustomerId"] = 5;
Or any other way to share a value between pages. Hidden fields or
query strings won't work, since this problem happens when the user
clicks on the back button of his browser, so there is no way to send
hidden fields values or parameters in the url. Any idea would be
appreciated. Thanks!

Matt

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Al Jones | last post by:
This is a repost form the vbscript newgroup - if this isn't the appropriate group would you point me toward one that is. Basically, I seem to be losing session data part way though preparing an...
0
by: Marco Solchio | last post by:
Hi We have a webapp that stores a Customer object and other information in session variables, and a CustomerID in a cookie. Since the app is being run on a webfarm, the session variables are...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
3
by: Dhruba Bandopadhyay | last post by:
I am a current ASP developer. I have files: ServiceClass.asp & SessionClass.asp which are included in many of my asp files. Then they call objService = New Service (by using the Class Service...
7
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I...
3
by: Meena | last post by:
Dear All, i have developed an application located on a server that has a front end and a back end interface, the application uses session object. when i log on as a backend user and a client user...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
6
by: Victor | last post by:
I've got a website that displays the same whether it is accessed using www. or not. ex: http://www.mysite.com and http://mysite.com give me exactly the same website (both represent the top...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.