 |
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

January 2nd, 2005, 12:12 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Session Object
Hi All,
What might be the reason that the code that has "SESSION" object works in one place but not in the other place?
I have two Session object variables for "User Name" and "Password" in the "Login Page". But, when I call another page, these Session variables don't carry over the values that were assigned in the "Login Page".
I checked the IIS of the other location and the cookies are allowed.
Thanks for your help.
mcinar
__________________
MCinar
Love all the creatures because of the creator.
|

January 2nd, 2005, 07:32 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
;;;What might be the reason that the code that has "SESSION" object works in one place but not in the other place?
A typo in the object name is about the only thing that comes to mind - EG "User Name" and "UserName" are very different. In short sessions are either working or they are not - how do you know they are working?
Are you using IIS 6.0, if so they have to be enabled.
Wind is your friend
Matt
|

January 2nd, 2005, 07:45 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Matt,
I will check the "Enable Session State" option in
IIS 6.0.
Thanks,
mcinar
|

January 2nd, 2005, 07:55 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
|

January 2nd, 2005, 08:02 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Thanks, Matt.
mcinar
|

January 8th, 2005, 01:54 PM
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
here's my problem
i use this code for logout:
<%Session.Abandon
if session("accountype") = "" then
response.Redirect "logout.asp?logoutsucceed=true"
else
response.redirect "logout.asp?logoutsucceed=false"
end if
%>
the problem is,my session("accountype") still contain with any data, even it has pass session.abandon, it should take twice logout to clean up my session. is there any sugestion might be help thx cheers
|

January 8th, 2005, 07:00 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
;;;my session("accountype") still contain with any data
What do you mean by this? there is still a value in the session variable after passing thru the session.abandon line?
Having:
Session.Abandon
At the head of your page will mean your if condition will always be true, there is no need for the else
Not completely understanding you
Wind is your friend
Matt
|

January 8th, 2005, 10:49 PM
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yes theres still a value in session variable after passing thru session.abandon
how i know?coz its still redirect to "logout.asp?logoutsucceed=false" and while we took logout for the seconde time then the page would redirect to "logout.asp?logoutsucceed=true"
i don't know why it could be
|

January 9th, 2005, 05:35 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Interesting replace
if session("accountype") = "" then
with
if trim(session("accountype")) = "" then
If that doesnt doesnt fix it, comment out your redirects and add some response.write's before and after the session.abandon to compare values
Wind is your friend
Matt
|

January 9th, 2005, 05:41 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
I just checked my .chm files on sessions
FYI:When the Abandon method is called, the current Session object is queued for deletion, but is not actually deleted until all of the script commands on the current page have been processed. This means that you can access variables stored in the Session object on the same page as the call to Abandon, but not in any subsequent Web pages.
Additionaly, here is one of my terminateSession.asp pages:
<%
Session.Abandon()
response.redirect("../index.asp?session=terminated")
%>
<script>
window.close();
</script>
Wind is your friend
Matt
|
|
 |