CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 How to default a Session Variable with a unique value

Print topic Send  topic

Author Message
Jan K. van Dalen
Posted: 05/07/2008, 9:41 PM

Hi Everyone,

Any recomendations on how to default the value of a session variable with an
unique numeric value?

IOW, when the user opens the site, I want to assign a value to a Session
Variable that will have a unique numeric value that has not been used before
nor will be use again for all users.

Any ideas?

Thanks.

wkempees


Posts: 1679
Posted: 05/08/2008, 4:07 AM

One way is to create a table in your database, Unique Autonum Key ID.
Sort of like a sequence_table.
I have to dig my memory banks, but I remember having a table with just one record allowed, could be that was in my Oracle days though.
At application session start, insert a record, retreive the last_inserted_id and use that.

Another way is to google for unique numbers using the atomic clock (lol), or
any value constructed from the date like strtotime() + sessionid.

Just my 2ct

Greetz, Jan

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.