Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Placing Cookies Using OWAS 3.0

Placing Cookies Using OWAS 3.0

From: <staylor_at_petrolsoft.com>
Date: Thu, 20 Aug 1998 23:48:14 GMT
Message-ID: <6ricju$hl7$1@nnrp1.dejanews.com>


Hello,

     I'm having a MAJOR problem with Oracle Web Application Server 3.0, and would really appreciate some help.

  I'm creating a web application which will have a login. I prompt the user for their login and password using a form, and then send that to a procedure. In the procedure, I check a table in the database and compare the login and password. If correct, I send a cookie to the user, and then call one of two main menus. Which menu procedure I call depends on the attributes of the user. In one menu, I just return some links, but in the other menu I do a select statement using the cookie I had just placed.

     Well, with the non-cookie menu, I have no problem. But, when I try to load the menu which calls the cookie, I get an error. After MUCH debugging, I have managed to narrow down the problem:

  It seems that there is a delay time between the placement of a cookie and the ability to access it. What I did was create a temp procedure that just displayed my cookie. When I call the procedure, it returns the previous user's info. But if I reload the page, I then get the correct user info. So, it seems that I need to put some kind of delay between the placement of a cookie and the use of it. Has anybody had a problem with this? Anybody know how to fix it? I had a suggestion to make a loop right after I place the cookie to test it's value until it's correct. Unfortunately, this may cause infinite loops and busy waiting, which I'd like to avoid.

     Here's my code if that will help:

PROCEDURE login (p_station in INTEGER, p_pin in INTEGER, p_count in INTEGER) IS cnt INTEGER; pin INTEGER; ord_status INTEGER; station_num

owa_cookie.cookie; BEGIN  owa_util.mime_header('text/html', FALSE); 
owa_cookie.send('STATION', p_station);	<----PLACING THE COOKIE 
owa_util.http_header_close;  SELECT count(*) INTO cnt FROM stations WHERE
statnum=p_station;  IF (cnt > 0)  THEN	SELECT pinnum INTO pin FROM stations
WHERE statnum=p_station;  IF p_pin = pin  THEN	SELECT ordentry INTO
ord_status from stations WHERE statnum=p_station; station_num := owa_cookie.get('STATION'); IF (ord_status=1) OR (ord_status=2) OR (ord_status=3) OR (ord_status=4) THEN main_menu; ELSE inv_man_menu; <----THIS IS THE MENU I GET ERRORS ON

PROCEDURE inv_man_menu IS oklock INTEGER; ord_status INTEGER; station_num owa_cookie.cookie; BEGIN station_num := owa_cookie.get('STATION'); <--HERE IS THE STATEMENT THAT FAILS SELECT OKTOLOCK, ORDENTRY INTO oklock, ord_status FROM stations WHERE statnum=station_num.vals(1);

Thanks In Advance,

Scott Taylor
Petrolsoft Corporation

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Aug 20 1998 - 18:48:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US