Forum Moderators: phranque

Message Too Old, No Replies

Session.SessionID

         

kevinj

10:02 pm on Aug 9, 2002 (gmt 0)

10+ Year Member



I'm using Authorize.net for credit card processing for a customer. I need to generate a unique invoice number for each order. I'm in the testing phases and currently am using the ASP Session Object Session.SessionID to generate the invoice number. Will this number always be unique to each order? Anyone aware of any drawbacks or potential problems using this method?

Thanks in advance.

JuDDer

10:37 pm on Aug 9, 2002 (gmt 0)

10+ Year Member



I believe the session ID will nearly always be unique.
I think I read somewhere that in heavy testing, two ID's the same were found somewhere.

I would always suggest a more robust approach, such as combining the session ID with the current date/time for example so you have a much higher chance of a unique identifier being created.

kevinj

2:03 am on Aug 10, 2002 (gmt 0)

10+ Year Member



thanks for the info. I'll look into adding the date and time.

JuniorHarris

12:53 pm on Aug 10, 2002 (gmt 0)

10+ Year Member



The SessionID will be reset whenever the web server is restarted, so it may be possible that the same number will be used again. Also, I believe in IE if a user selects a 'new window' the new browser window will have the same SessionID, thus the user would have two windows with the same SessionID.