Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Session variables and browsers

3 posts in General Discussion (old) Last posting was on 2000-03-08 16:26:56.0Z
Basant Gupta Posted on 2000-03-07 23:45:34.0Z
Newsgroups: sybase.public.easerver
Date: Tue, 07 Mar 2000 15:45:34 -0800
From: Basant Gupta <basantg@yahoo.com>
X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Session variables and browsers
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 20
NNTP-Posting-Host: 207.171.209.94
Message-ID: <347_38C5949E.E778D350@yahoo.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26926
Article PK: 157881

Hi,
I am having problems accessing session variables with the I.E.
browser. The following server-side code works fine in Netscape.

session.ib_served = false; //set in login page

//the following code is called in another page
if (session.ib_served == false) {
//do processing
}

When I run the following code in I.E (5.00.2314.1003) I get the
following message:
Warning: undefined variable session.ib_served[ib_served] near line
78 in "/project/form_server_process.ssc"

I have a few other places where I am having problems accessing
session variables. The funny thing is that the script is evaluated on
the server-side. Thus it should be completely browser-independent. I
have enabled cookies in I.E.

Basant Gupta


Michael F. Nicewarner [TeamSybase] Posted on 2000-03-08 13:51:23.0Z
Newsgroups: sybase.public.easerver
From: "Michael F. Nicewarner [TeamSybase]" <mike.nicewarner@ibpinc.com>
Subject: Re: Session variables and browsers
Date: Wed, 8 Mar 2000 07:51:23 -0600
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: secure.ibpinc.com 198.133.192.2
Message-ID: <347_v7s2EYQi$GA.74@forums.sybase.com>
References: <347_38C5949E.E778D350@yahoo.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26900
Article PK: 157859

I have had problems getting session variables to work, too. To debug it,
try printing the contents of the session variable just after it is set, then
later on in another page. You can prevent the error message by using IF
exists(session.ib_served) before you check for a false value. Another thing
is that you don't have to explicitly check "== false". Just put "!" before
it, as in "if (!session.ib_served)". That does the same thing. I would
modify your code like this:
session.ib_served = false;
document.writeln('session.ib_served = ' +
(exists(session.ib_served)?session.ib_served:'NOT EXISTS') + '<br>');
// put the above line wherever you want, to check for the value.
This might help you find where it is getting lost.

In the other page:
if (exists(session.ib_served) && !session.ib_served)
{
// do processing
}

HTH.

--

Michael F. Nicewarner [TeamSybase]
mailto:mike.nicewarner@ibpinc.com
http://www.datamodel.org

Basant Gupta <basantg@yahoo.com> wrote in message
news:38C5949E.E778D350@yahoo.com...
> Hi,
> I am having problems accessing session variables with the I.E.
> browser. The following server-side code works fine in Netscape.
>
> session.ib_served = false; file://set in login page
>
> file://the following code is called in another page
> if (session.ib_served == false) {
> file://do processing
> }
>
> When I run the following code in I.E (5.00.2314.1003) I get the
> following message:
> Warning: undefined variable session.ib_served[ib_served] near line
> 78 in "/project/form_server_process.ssc"
>
> I have a few other places where I am having problems accessing
> session variables. The funny thing is that the script is evaluated on
> the server-side. Thus it should be completely browser-independent. I
> have enabled cookies in I.E.
>
> Basant Gupta
>


Basant Gupta Posted on 2000-03-08 16:26:56.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 08 Mar 2000 08:26:56 -0800
From: Basant Gupta <basantg@yahoo.com>
X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Session variables and browsers
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 65
NNTP-Posting-Host: 207.171.209.94
Message-ID: <347_38C67F50.429A2F49@yahoo.com>
References: <347_38C5949E.E778D350@yahoo.com> <347_v7s2EYQi$GA.74@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26885
Article PK: 157846

Thanks Michael,
I actually found out the source of my problem. I had a line of code that
went like this:

document.writeln("<meta content='1;url=http://machine_name/app/main.htm'
http-equiv='refresh'>");

For some reason, in I.E it would reset the session variables so that the
session variable would be undefined. This would work fine in Netscape. After
changing the code to

document.writeln("<meta content='1;url=main.htm' http-equiv='refresh'>");

It now works fine in both Netscape and I.E.

Basant Gupta

"Michael F. Nicewarner [TeamSybase]" wrote:

> I have had problems getting session variables to work, too. To debug it,
> try printing the contents of the session variable just after it is set, then
> later on in another page. You can prevent the error message by using IF
> exists(session.ib_served) before you check for a false value. Another thing
> is that you don't have to explicitly check "== false". Just put "!" before
> it, as in "if (!session.ib_served)". That does the same thing. I would
> modify your code like this:
> session.ib_served = false;
> document.writeln('session.ib_served = ' +
> (exists(session.ib_served)?session.ib_served:'NOT EXISTS') + '<br>');
> // put the above line wherever you want, to check for the value.
> This might help you find where it is getting lost.
>
> In the other page:
> if (exists(session.ib_served) && !session.ib_served)
> {
> // do processing
> }
>
> HTH.
>
> --
>
> Michael F. Nicewarner [TeamSybase]
> mailto:mike.nicewarner@ibpinc.com
> http://www.datamodel.org
>
> Basant Gupta <basantg@yahoo.com> wrote in message
> news:38C5949E.E778D350@yahoo.com...
> > Hi,
> > I am having problems accessing session variables with the I.E.
> > browser. The following server-side code works fine in Netscape.
> >
> > session.ib_served = false; file://set in login page
> >
> > file://the following code is called in another page
> > if (session.ib_served == false) {
> > file://do processing
> > }
> >
> > When I run the following code in I.E (5.00.2314.1003) I get the
> > following message:
> > Warning: undefined variable session.ib_served[ib_served] near line
> > 78 in "/project/form_server_process.ssc"
> >
> > I have a few other places where I am having problems accessing
> > session variables. The funny thing is that the script is evaluated on
> > the server-side. Thus it should be completely browser-independent. I
> > have enabled cookies in I.E.
> >
> > Basant Gupta
> >