cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with get and set brower cookies.

Former Member
0 Kudos

Hi

I need put (save) some temporary data to client site. And then I need read this dada.

I decide use Cookies.

I set data using:

WDR_TASK=>REQUEST->SET_COOKIE(
        exporting
          NAME    'MYDATA'
           VALUE   =  'test value'
                       ).


I read data using this ways:

CALL METHOD LO_REQUEST->IF_HTTP_ENTITY~GET_COOKIE
     EXPORTING
       NAME    = 'MYDATA'
     IMPORTING
       VALUE   = zCookies
       .


   wdr_task=>REQUEST->GET_COOKIE(
     exporting
       NAME    = 'MYDATA'
     importing
       VALUE   = zCookies
   ).


   WDR_TASK=>REQUEST->GET_COOKIES(
     changing
       COOKIES = myCookies
   ).

When I use read and set in same method, I got data. But when I read data in different methods (or I use F5 - refresh browser) I don't get data from cookies.

How can I set/get data on client site?


Minor but important question:

Is possible read from client browser (computer) unique text/value (something with I can identify client)?


Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

I try this scenario in ASP.NET.

When I want set I must use this code:

HttpCookie myCookie = new HttpCookie("UserSettings");

myCookie["testCookie"] = "my value";

Response.Cookies.Add(myCookie);

for get:

Request.Cookies["UserSettings"]["testCookie"]

Best regards