Create Server-Side Cookies

By Vakada Raghava, Mouri Tech Solutions

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

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

Go to SE80

Create a BSP application

Create a page

Click on layout tab

Paste the code in layout tab
<html>
<body>
Selection page
Stateful or stateless?
<form method="post">
<table>
<tr>
<td>stateful</td>
<td><input type=text name="LAST_STRING_ADDED" value="" >
</td>
<td><input type=text name="NEXT_STRING" value="" >
</td>
<td><input type=submit name="onInputProcessing(request)" value="Retrieve"></td></tr>
<tr>
<td>stateless</td>
<td><input type=submit name="onManipulation(manipulate)" value="Store"></td></tr>
</table>
</form>
</body>
</html>

Click on event handler tab

Paste it below code

Select oninputprocessing, Paste the below code 

onManipulation code

  • event handler to manipulate dynamically the HTTP stream
data: PAGE_DATA type XSTRING.
data: NAME type STRING.
export LAST_STRING_ADDED from LAST_STRING_ADDED
STRINGS from STRINGS
to data buffer PAGE_DATA.
NAME = SY-UNAME.
call method CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE
exporting
NAME = 'my_cookies'
APPLICATION_NAME = 'ZCOOKIES '
APPLICATION_NAMESPACE ='ZCOOKIES '
USERNAME = NAME
SESSION_ID = 'same_for_all'
DATA_NAME = 'page_data'
DATA_VALUE = PAGE_DATA
EXPIRY_TIME_REL = 3600
To continue...click here

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image