Re: Setting cookies using WebDatablade.
Posted in 2003
Topics: Stored Procedures & SPL, Platform-Specific Issues
I actually don't have session set in the config file. I am also setting the cookies in a dynamic tag. The following is what I am using to set the cookies. <?MIVAR>$(HTTPHEADER,set-cookie,district=$dist)<?/MIVAR> <?MIVAR>$(HTTPHEADER,set-cookie,district_name=$district_temp)<?/MIVAR> <?MIVAR>$(HTTPHEADER,set-cookie,district_address1=$district_taddress1)<?/MIVAR> <?MIVAR>$(HTTPHEADER,set-cookie,district_city=$district_tcity)<?/MIVAR> <?MIVAR>$(HTTPHEADER,set-cookie,district_state=$district_tstate)<?/MIVAR> <?MIVAR>$(HTTPHEADER,set-cookie,district_zip=$district_tzip)<?/MIVAR> <?MIVAR>$(HTTPHEADER,set-cookie,district_logo=$district_tlogo)<?/MIVAR> <?MIVAR>$(HTTPHEADER,set-cookie,district_database=$district_tdatabase)<?/MIVAR> <?/MIBLOCK> The variables have been read from the database in the dynamic tag. Harry, Paul Watson <paul@oninit.com> wrote in message news:<3FB10D7F.A62B9456@oninit.com>... > What is session set to in the config file? Do both Netscape and > IE have the problem > > Harry Johnson wrote: > > > > hjohnson@keeneinfo.com (Harry Johnson) wrote in message news:<6830f442.0311101453.4852fa5@posting.google.com>... > > > I am having a problem passing multiple cookies from one page to the > > > other. I am using web.4.10.UC1. With debug level of "-1", I can see > > > the cookies are being set in the driver log but when I display the > > > cookie, it is null. Has anyone had this problem? > > > > > > Thanks, > > > > Thanks for your help. > > > > The webserver is Apache and I am running it on Redhat Linux 7.3.
Harry Johnson wrote: > I actually don't have session set in the config file. I am also > setting the cookies in a dynamic tag. The following is what I am > using to set the cookies. > > <?MIVAR>$(HTTPHEADER,set-cookie,district=$dist)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_name=$district_temp)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_address1=$district_taddress1)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_city=$district_tcity)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_state=$district_tstate)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_zip=$district_tzip)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_logo=$district_tlogo)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_database=$district_tdatabase)<?/MIVAR> > <?/MIBLOCK> > > The variables have been read from the database in the dynamic tag. > > Harry, > Try adding some parameters to the cookies: <?MIVAR>$(HTTPHEADER,set-cookie,district=$dist; path=/; expires=Friday, 28-Nov-2003 01:00:00 GMT)<?/MIVAR> Setting the expires thing will cause the cookie to be saved to a file on disk. Additionally if you set IE to always ask about cookies, you can see it trying to be set. Based on the information I've seen so far, I'd guess that the cookies are not being set for the correct path. As Paul has noted, using the session variables is probably a better route than cookies anyway (let web datablade manage it). -- I am saddened that spammers forced me to put: rob_wilson at-sign ameritech dot net
Harry I don't use cookies in the way you are trying to. By setting the session variable to auto the WebBlade will allow you to manage session based variables that can be used in a very similar way to standard cookies. <?MIVAR name=session.dist>$dist</?MIVAR> this will assign the value of dist to the session. Each session can be uniquely identified using $session.ID (note the case). The advantage of this approach is if the browser doesn't use cookies/not allowed the session ID is embedded into the url. Even with cookies enabled in the browser the only data stored at the PC end is the session ID, therefore all the session data is stored at the server end, so if theory the data should be more secure. AFAIK it's not possible to fake the session ID from another PC The TTL of the session is controlled via the web admin page which IMHO makes life easier. Anyway check out sessions - they do exactly what they say on the tin Cheers Paul Harry Johnson wrote: > > I actually don't have session set in the config file. I am also > setting the cookies in a dynamic tag. The following is what I am > using to set the cookies. > > <?MIVAR>$(HTTPHEADER,set-cookie,district=$dist)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_name=$district_temp)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_address1=$district_taddress1)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_city=$district_tcity)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_state=$district_tstate)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_zip=$district_tzip)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_logo=$district_tlogo)<?/MIVAR> > <?MIVAR>$(HTTPHEADER,set-cookie,district_database=$district_tdatabase)<?/MIVAR> > <?/MIBLOCK> > > The variables have been read from the database in the dynamic tag. > > Harry, > > Paul Watson <paul@oninit.com> wrote in message news:<3FB10D7F.A62B9456@oninit.com>... > > What is session set to in the config file? Do both Netscape and > > IE have the problem > > > > Harry Johnson wrote: > > > > > > hjohnson@keeneinfo.com (Harry Johnson) wrote in message news:<6830f442.0311101453.4852fa5@posting.google.com>... > > > > I am having a problem passing multiple cookies from one page to the > > > > other. I am using web.4.10.UC1. With debug level of "-1", I can see > > > > the cookies are being set in the driver log but when I display the > > > > cookie, it is null. Has anyone had this problem? > > > > > > > > Thanks, > > > > > > Thanks for your help. > > > > > > The webserver is Apache and I am running it on Redhat Linux 7.3. -- Paul Watson # Oninit Ltd # Growing old is mandatory Tel: +44 1436 672201 # Growing up is optional Fax: +44 1436 678693 # Mob: +44 7818 003457 # www.oninit.com #
Rob Wilson <rob_wilson_@_see.sig> wrote in message news:<oYvsb.20971$8x2.8085966@newssrv26.news.prodigy.com>... > Harry Johnson wrote: > > I actually don't have session set in the config file. I am also > > setting the cookies in a dynamic tag. The following is what I am > > using to set the cookies. > > > > <?MIVAR>$(HTTPHEADER,set-cookie,district=$dist)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_name=$district_temp)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_address1=$district_taddress1)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_city=$district_tcity)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_state=$district_tstate)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_zip=$district_tzip)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_logo=$district_tlogo)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_database=$district_tdatabase)<?/MIVAR> > > <?/MIBLOCK> > > > > The variables have been read from the database in the dynamic tag. > > > > Harry, > > > > Try adding some parameters to the cookies: > > <?MIVAR>$(HTTPHEADER,set-cookie,district=$dist; path=/; expires=Friday, > 28-Nov-2003 01:00:00 GMT)<?/MIVAR> > > Setting the expires thing will cause the cookie to be saved to a file on > disk. Additionally if you set IE to always ask about cookies, you can > see it trying to be set. > > Based on the information I've seen so far, I'd guess that the cookies > are not being set for the correct path. > > As Paul has noted, using the session variables is probably a better > route than cookies anyway (let web datablade manage it). Rob, Thanks for your help. It appears that the only cookie set is the last one in the list. In the above example, only "district_database" is set. It is the last one. If I take the last line off, I get the next one up or "district_logo". I quess I need to find out how to put multiple cookies in one HTTPHEADER statement. The reason I am trying to use cookies is to hide the information from the user. I don't want the user to see the variable in the URL when going from one screen to another. Harry,
Paul, Thanks for all your help. I will try your method. I does seem to be a better method. I will let you know how it comes out. By the way, I went to the Infobahn several months ago and IBM said that the WebDatablade was going to be supported for years to come. I hope it does. We have created many applications using it. What have you heard? Harry, Paul Watson <paul@oninit.com> wrote in message news:<3FB294BC.3CA4061E@oninit.com>... > Harry > > I don't use cookies in the way you are trying to. By setting the > session variable to auto the WebBlade will allow you to manage > session based variables that can be used in a very similar way > to standard cookies. > > <?MIVAR name=session.dist>$dist</?MIVAR> > > this will assign the value of dist to the session. Each session > can be uniquely identified using $session.ID (note the case). The > advantage of this approach is if the browser doesn't use cookies/not > allowed the session ID is embedded into the url. > > Even with cookies enabled in the browser the only data stored > at the PC end is the session ID, therefore all the session data > is stored at the server end, so if theory the data should be more > secure. AFAIK it's not possible to fake the session ID from > another PC > > The TTL of the session is controlled via the web admin page > which IMHO makes life easier. > > Anyway check out sessions - they do exactly what they say on the tin > > Cheers > > Paul > > Harry Johnson wrote: > > > > I actually don't have session set in the config file. I am also > > setting the cookies in a dynamic tag. The following is what I am > > using to set the cookies. > > > > <?MIVAR>$(HTTPHEADER,set-cookie,district=$dist)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_name=$district_temp)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_address1=$district_taddress1)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_city=$district_tcity)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_state=$district_tstate)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_zip=$district_tzip)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_logo=$district_tlogo)<?/MIVAR> > > <?MIVAR>$(HTTPHEADER,set-cookie,district_database=$district_tdatabase)<?/MIVAR> > > <?/MIBLOCK> > > > > The variables have been read from the database in the dynamic tag. > > > > Harry, > > > > Paul Watson <paul@oninit.com> wrote in message news:<3FB10D7F.A62B9456@oninit.com>... > > > What is session set to in the config file? Do both Netscape and > > > IE have the problem > > > > > > Harry Johnson wrote: > > > > > > > > hjohnson@keeneinfo.com (Harry Johnson) wrote in message news:<6830f442.0311101453.4852fa5@posting.google.com>... > > > > > I am having a problem passing multiple cookies from one page to the > > > > > other. I am using web.4.10.UC1. With debug level of "-1", I can see > > > > > the cookies are being set in the driver log but when I display the > > > > > cookie, it is null. Has anyone had this problem? > > > > > > > > > > Thanks, > > > > > > > > Thanks for your help. > > > > > > > > The webserver is Apache and I am running it on Redhat Linux 7.3.