cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Server side cookies

Former Member
0 Likes
1,296

Hello,

I am setting a server side cookie for saving an internal table in the following way


concatenate 'xx' lijstnaam+0(18) kunnr into name.
CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE
  EXPORTING
    NAME                  = name
    APPLICATION_NAME      = 'Thumb_lijst'
    APPLICATION_NAMESPACE = 'Thumb_lijst'
    USERNAME              = kunnr
    SESSION_ID            = 'NONE'
    DATA_VALUE            = it_thumb_line
    DATA_NAME             = 'THUMB_LIJST'
*    EXPIRY_TIME_ABS       =
*    EXPIRY_DATE_ABS       =
      EXPIRY_TIME_REL       = '82800'  "23 h
*    EXPIRY_DATE_REL       =
    .

When I call this from the browser everything works fine, when I try to retrieve the cookie with the method GET_SERVER_COOKIE it works perfect.

Now my problem is that I want to generate this server side cookie before I even open up the browser.

In that way the client doesn’t have to wait for a time consuming remote function call.

The problem now is that the cookie is perfectly generated in advance, but when I open the browser and try to retrieve the cookie it doesn’t find anything alltough there is an entry in table SSCOOKIE.

So the RFC starts, gets the data and stores it in a cookie.

This generates two additional lines in SSCOOKIE with identical values as the first line.

The only field that differs is the expirytime.

So now there are three lines in SSCOOKIE.

If the customer then again clicks on a button to retrieve the cookie it works perfect.

So my question is : is it possible to generate server side cookies in advance so that when a customer opens his browser all is stored in cookies and there is no need to call time consuming RFC’s.

Thanks in advance for any clues, info, …

Dirk.

Accepted Solutions (0)

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Likes

yours is a stateless or stateful application. if its stateful, instead of cookies, you can use application class to hold the data

Former Member
0 Likes

It is a stateless application, I want to reduce the waiting time for a customer by preparing cookies for that particular customer in advance.

Regards.

Dirk.

Former Member
0 Likes

I figured out that the cookie-mechanism is using import / export to / from database SSCOOKIE.

Those methods are using dataclusters wich are saved in transaction-specific ABAP-memory.

So I think that is the reason that my idea doesn't work.

Does anybody know a workaround for this problem ?

Regards,

Dirk.

Patrick_McMahon
Contributor
0 Likes

Hi Dirk,

If the RFC is taking too long and the data does not have to be real-time, one solution would be to store the data locally and update periodically.

Regards,

Patrick.

Former Member
0 Likes

Hello Patrick,

That idea sure is worth thinking about, it requires some redesign of my BSP's but it could be an elegant solution.

Thanks for the tip,

Dirk.

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes

Hi Dirk,

if you are looking at storing the data somewhere it can be quickly accessed try looking at ABAP Shared Objects.

Cheers

Graham Robbo

Former Member
0 Likes

Hello Graham,

Unfortunately we are still using version 6.20.

But it is good study material for the future.

Regards,

Dirk.