|
-
Jul 9th, 2001, 01:07 PM
#1
Thread Starter
Frenzied Member
Session Variable Clarification
Okay... I have a question...
There is an ASP that lets you modify an employees contact info. You select the employee (say Joe) from a drop down box and click on a link and boom, you are in a form to update some stuff.
If you say "File -> New -> Window" in IE (and I'm sure the same in Netscape) then you now have two browsers open to the same modify employee page. Lets call these browser instance A and B.
Okay, go back in B. Select a different employee (say Bob). Change the information in A and submit. A will go back to the start page by default. If you look in the list of employee, there are now two Joes. The original one, and the one that just overwrote Bob.
The problem is, Session Variables. How can I set these up to limit themselves to just one instance of a browser and avoid this problem?
My immediate solution is to use hidden inputs instead of session variables.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jul 9th, 2001, 01:28 PM
#2
Black Cat
Sessions are based on Cookies, and as far as I know, web browsers will return the Cookie across different browser windows. It would have to be a client-config option...
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jul 9th, 2001, 02:12 PM
#3
Thread Starter
Frenzied Member
Which means that I'll have to use the hidden inputs.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jul 9th, 2001, 03:29 PM
#4
Frenzied Member
Just another reason to not use Session variables...
Keep your page stateless...
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Jul 9th, 2001, 05:47 PM
#5
well... here's a solution... as long as the user doesn't press F5 or Refresh as if that'll ever happen... but, after a few times, s/he will learn not to... lol...
Code:
' check for multiple clients with same session id
Session("clientCount") = Session("clientCount") + 1
If Session("clientCount") > 1 Then ' this window doesn't belong
Response.Redirect "http://www.vbworld.com"
End If
i put it at the very top of the page... and it works fine for my scenario, except for when one refreshes the original window... maybe a hidden or querystring variable could be used to designate which window is the original window?... i'm going home... so good luck...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|