Home All Groups Group Topic Archive Search About


Author
9 Mar 2006 10:28 PM
isaac2004
how would go about making a session timeout expire with a method like
you can expire a cookie by going Date() - 1

Author
9 Mar 2006 10:37 PM
Evertjan.
isaac2004 wrote on 09 mrt 2006 in microsoft.public.inetserver.asp.general:

> how would go about making a session timeout expire with a method like
> you can expire a cookie by going Date() - 1
>
>

Why would you want to do that?

session.abandon is the way to go.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
10 Mar 2006 7:41 AM
isaac2004
>Why would you want to do that?

i have a db driven shopping cart that uses a session id as a varible
for storring individual carts and items

>session.abandon is the way to go.\

isnt this method unefficient and is there any other way
Author
10 Mar 2006 9:17 AM
Evertjan.
isaac2004 wrote on 10 mrt 2006 in microsoft.public.inetserver.asp.general:

>>Why would you want to do that?
>
> i have a db driven shopping cart that uses a session id as a varible
> for storring individual carts and items

Yes, so?

One advice, never use systemvariables directly in code.

For one it precludes efficient testing with virtual values.

And now you see for yourself you will have to use measures the system is
not ment for.
say you want to keep the session identity of the user for other reasons?

>>session.abandon is the way to go.\
>
> isnt this method unefficient

Why?

What would be "inefficient" about it, and why would that matter to you?

setting the session timeout to a time in the past [if possible?] IS!!
abandoning the session, IMHO!!!

> and is there any other way

Yes, Do not use the session id for other things than
identifying the user's session.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
12 Mar 2006 12:19 PM
Egbert Nierop (MVP for IIS)
"isaac2004" <isaac_2***@yahoo.com> wrote in message
news:1141976493.491036.240080@i39g2000cwa.googlegroups.com...
> >Why would you want to do that?
>
> i have a db driven shopping cart that uses a session id as a varible
> for storring individual carts and items
>
>>session.abandon is the way to go.\
>
> isnt this method unefficient and is there any other way

Session.SessionID is _very_ unreliable!
This is because the SessionID is just a numeric value, that can be reset at
any time, and it is not a unique number!

Identify your basket using a string-GUID for instance,


--
compatible web farm Session replacement for Asp and Asp.Net (1.1)
http://www.nieropwebconsult.nl/asp_session_manager.htm
Author
12 Mar 2006 5:14 PM
Evertjan.
Egbert Nierop (MVP for IIS) wrote on 12 mrt 2006 in
microsoft.public.inetserver.asp.general:

Show quote
>
> "isaac2004" <isaac_2***@yahoo.com> wrote in message
> news:1141976493.491036.240080@i39g2000cwa.googlegroups.com...
>> >Why would you want to do that?
>>
>> i have a db driven shopping cart that uses a session id as a varible
>> for storring individual carts and items
>>
>>>session.abandon is the way to go.\
>>
>> isnt this method unefficient and is there any other way
>
> Session.SessionID is _very_ unreliable!
> This is because the SessionID is just a numeric value, that can be
> reset at any time, and it is not a unique number!

And how many sessions would you need to have at one time to come near the
number that the session ID has a reasonable chance of being duplicated?

> Identify your basket using a string-GUID for instance,

Isn't that just as resettable?

===========

Read further, I do not advice abandoning the session, just to throw away a
basket.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
12 Mar 2006 9:09 PM
isaac2004
hey i found out that i can just use the delete part of a SQL statement
to erase all fields, the only problem is that it gives me this error
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
1.

doesnt this mean that i am trying to delete something that doesnt
exist, here is the delete SQL code

strDeleteSQL = "DELETE FROM tblCart WHERE strSessionID = " &
strSessionID
   objRS.Open strDeleteSQL, objConn, adOpenForwardOnly,
adLockOptimistic

does this look right
thanks for the help
Author
12 Mar 2006 9:12 PM
Evertjan.
isaac2004 wrote on 12 mrt 2006 in microsoft.public.inetserver.asp.general:

> hey i found out that i can just use the delete part of a SQL statement
>

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the article
headers. <http://www.safalra.com/special/googlegroupsreply/>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
12 Mar 2006 9:47 PM
isaac2004
>Please quote what you are replying to.

sorry alot of people were giving advice so i thought just by doing that
it would limit confusion

anyway i started this thread with an original problem that i fixed, now
there is another problem, i get this error

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
1.

doesnt this mean that i am trying to delete something that doesnt
exist, here is the delete SQL code


strDeleteSQL = "DELETE FROM tblCart WHERE strSessionID = " &
strSessionID
   objRS.Open strDeleteSQL, objConn, adOpenForwardOnly,
adLockOptimistic


does this look right
thank you all for the help
Author
13 Mar 2006 4:20 PM
Evertjan.
isaac2004 wrote on 12 mrt 2006 in microsoft.public.inetserver.asp.general:

>>Please quote what you are replying to.
>
> sorry alot of people were giving advice so i thought just by doing that
> it would limit confusion
>
> anyway i started this thread with an original problem that i fixed, now
> there is another problem, i get this error

Again a lack of Usenet Netiquette.

Do not ask a new unrelated question in an old thread.

Start a new thread with a new telling subject text.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
13 Mar 2006 4:29 PM
Bob Barrows [MVP]
isaac2004 wrote:
>> Please quote what you are replying to.
>
> sorry alot of people were giving advice so i thought just by doing
> that it would limit confusion
>
> anyway i started this thread with an original problem that i fixed,
> now there is another problem, i get this error
>
> [Microsoft][ODBC Microsoft Access Driver]

http://www.aspfaq.com/show.asp?id=2126

> Too few parameters. Expected
> 1.
>
> doesnt this mean that i am trying to delete something that doesnt
> exist, here is the delete SQL code
>
No. It means you've specified an object, either a table or a field name,
that does not exist in your database. It could also mean that you used a
reserved keyword to name one of the objects that is specified in the query
without using brackets to delimit that word. However, I see no reserved
keywords in your query so that's not the problem.
>
> strDeleteSQL = "DELETE FROM tblCart WHERE strSessionID = " &
> strSessionID
>    objRS.Open strDeleteSQL, objConn, adOpenForwardOnly,
> adLockOptimistic
>
>

> does this look right

I don't know. Does your tblCart table really have a field called
"strSessionID"?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Author
15 Mar 2006 9:13 PM
Egbert Nierop (MVP for IIS)
Show quote
"Evertjan." <exjxw.hannivo***@interxnl.net> wrote in message
news:Xns9784B9873378Ceejj99@194.109.133.242...
> Egbert Nierop (MVP for IIS) wrote on 12 mrt 2006 in
> microsoft.public.inetserver.asp.general:
>
>>
>> "isaac2004" <isaac_2***@yahoo.com> wrote in message
>> news:1141976493.491036.240080@i39g2000cwa.googlegroups.com...
>>> >Why would you want to do that?
>>>
>>> i have a db driven shopping cart that uses a session id as a varible
>>> for storring individual carts and items
>>>
>>>>session.abandon is the way to go.\
>>>
>>> isnt this method unefficient and is there any other way
>>
>> Session.SessionID is _very_ unreliable!
>> This is because the SessionID is just a numeric value, that can be
>> reset at any time, and it is not a unique number!
>
> And how many sessions would you need to have at one time to come near the
> number that the session ID has a reasonable chance of being duplicated?

Well at least with windows 2000, this was just a sequential number. I did
not test it for windows xp/2003 but the number is just a hashcode to a
bucket. It is not the right way to be unique.

>> Identify your basket using a string-GUID for instance,
>
> Isn't that just as resettable?

no.
The chance for duplicates is nill.

Show quote
> ===========
>
> Read further, I do not advice abandoning the session, just to throw away a
> basket.
Author
15 Mar 2006 11:43 PM
Evertjan.
Egbert Nierop (MVP for IIS) wrote on 15 mrt 2006 in
microsoft.public.inetserver.asp.general:

>> And how many sessions would you need to have at one time to come near
>> the number that the session ID has a reasonable chance of being
>> duplicated?
>
> Well at least with windows 2000, this was just a sequential number. I
> did not test it for windows xp/2003 but the number is just a hashcode
> to a bucket. It is not the right way to be unique.
>

Under W2003 it is a very long string. Unicity is not needed, only relative
unicity.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
16 Mar 2006 2:59 PM
Egbert Nierop (MVP for IIS)
Show quote
"Evertjan." <exjxw.hannivo***@interxnl.net> wrote in message
news:Xns978876DADF65eejj99@194.109.133.242...
> Egbert Nierop (MVP for IIS) wrote on 15 mrt 2006 in
> microsoft.public.inetserver.asp.general:
>
>>> And how many sessions would you need to have at one time to come near
>>> the number that the session ID has a reasonable chance of being
>>> duplicated?
>>
>> Well at least with windows 2000, this was just a sequential number. I
>> did not test it for windows xp/2003 but the number is just a hashcode
>> to a bucket. It is not the right way to be unique.
>>
>
> Under W2003 it is a very long string. Unicity is not needed, only relative
> unicity.

Possibly they've changed the number as a hashcode from a GUID.

Still, I would not use the SessionID as unique identifier. It is not
documented to be unique.
Author
16 Mar 2006 3:44 PM
Evertjan.
Egbert Nierop (MVP for IIS) wrote on 16 mrt 2006 in
microsoft.public.inetserver.asp.general:

Show quote
>
> "Evertjan." <exjxw.hannivo***@interxnl.net> wrote in message
> news:Xns978876DADF65eejj99@194.109.133.242...
>> Egbert Nierop (MVP for IIS) wrote on 15 mrt 2006 in
>> microsoft.public.inetserver.asp.general:
>>
>>>> And how many sessions would you need to have at one time to come
>>>> near the number that the session ID has a reasonable chance of
>>>> being duplicated?
>>>
>>> Well at least with windows 2000, this was just a sequential number.
>>> I did not test it for windows xp/2003 but the number is just a
>>> hashcode to a bucket. It is not the right way to be unique.
>>>
>>
>> Under W2003 it is a very long string. Unicity is not needed, only
>> relative unicity.
>
> Possibly they've changed the number as a hashcode from a GUID.
>
> Still, I would not use the SessionID as unique identifier. It is not
> documented to be unique.

But that was not my point, Egbert.

You do not need a unique identifier for a shopping card, as the number of
concurent users is very small, compared to, say, a database filled with
all inhabitantss of the Netherlands.

if you keep the chance of concurrency below, say, once in a hundred
thousand years, wouldn't that be enough?

btw: an "unique identifier" is not unique at all, it is just a pseudo
random string and it only is unique compared to the practical chance of
doublures during time spans like the age of the universe.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

AddThis Social Bookmark Button