Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Sessions variable disconnects
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Astralis
Senior Member

USA
1218 Posts

Posted - 11 January 2005 :  17:25:34  Show Profile  Send Astralis a Yahoo! Message
Okay, I'm not exactly sure what's happening so I'll go through the steps and hope someone can help.

When I templatize a page, the session variable disappears. So, on test.asp, if I call Session("CC_Username") I can see the session.

But, when I place the include header.asp page in test.asp, the Session variable won't become defined.


This is what's in the header:

<%
Dim CC_Username
if isempty(Session("CC_Username")) then 
Session("CC_Username") = rsCheckUser("U_ID")
end if
%>


If I remove the header and place that code in test.asp, then it does appear.

So, I thought maybe the rsCheckUser wasn't open, but it is and I'm not receiving any error.

Any explanation?

Doug G
Support Moderator

USA
6493 Posts

Posted - 12 January 2005 :  02:03:14  Show Profile
Make sure the include file is in the same web application as your main asp page, for one thing.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 12 January 2005 :  04:03:51  Show Profile  Visit D3mon's Homepage
Sometimes you have to do this twice to get it to 'stick':

Session("CC_Username") = rsCheckUser("U_ID")
Session("CC_Username") = rsCheckUser("U_ID")


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 12 January 2005 :  22:45:10  Show Profile
If you have to do it twice, something else is not quite right.

I've never had a problem setting a session variable where I needed to duplicate the code that set the value.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07