Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 03-29-2006, 01:18 AM extract session ID
Average Talker

Posts: 19
Trades: 0
Hello all. I was wanting to use a table in my database for temporary storage, and was wondering if it is possible to use the user's session ID as a unique identifier in the table, and then delete the records containing that session ID from the database upon closing the session? If not, is there another practicle way of doing this?

Thanks,

Parallon
parallon is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-29-2006, 01:33 AM Re: extract session ID
Average Talker

Posts: 19
Trades: 0
Ok, I figured it out. But, I have one question about this. I notice that when I log out, and then log back in, I am issued the same session ID. Is there a way to prevent this? I know that once you close the browser, it is deleted. Does it really matter?

Thanks,

Parallon
parallon is offline
Reply With Quote
View Public Profile
 
Old 03-29-2006, 03:13 AM Re: extract session ID
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the session will be deleted 20 minutes after the browser is closed or after 20 mins with no activity. If you reconnect during the 20 mins with the same browser the same session ID will apply.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-29-2006, 03:54 AM Re: extract session ID
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
I'd do it the other way around, just because the user's unique identifier may not necessarily change. This is why I traditionally don't use it.

I do it like this:

Check for Session ID value (NOT the unique identifier at this stage, I'll explain below):
If no Session ID value, create from database-generated auto number/unique identifier field.

In other words, let your database create the unique identifier by assigning a new record and use THAT as your session identifier. No matter what, it will never be duplicated.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to extract session ID
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20855 seconds with 12 queries