on 12-22-2004 7:55 AM
Hi,
I use server side cookie to pass value between two pages.
But if I blocked all cookie in my broswer setting, and the server cookie doesn't work.
How could I pass value in this condition?
Thank you!
Hi Eason,
that's not possible: client settings cannot block the server side cookie.
Let's assume this coding in the OnInputprocessing at page A:
username = sy-uname.
TRANSLATE username TO LOWER CASE.
Store.
cl_bsp_server_side_cookie=>set_server_cookie( name = 'SEARCH'
application_name = runtime->application_name
application_namespace = runtime->application_namespace
username = username
session_id = runtime->session_id
data_name = 'FOUNDS'
data_value = founds
expiry_time_rel = '600' ).
This defines a ssc (server side cookie).
You can show cookies via report BSP_SHOW_SERVER_COOKIES.
On page B (the successor of A) you can get the content via:
CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
EXPORTING
name = 'SEARCH'
application_name = runtime->application_name
application_namespace = runtime->application_namespace
username = username
session_id = runtime->session_id
data_name = 'FOUNDS'
CHANGING
data_value = founds.
Try this.
Best regards,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your reply.
I use winXP professional SP1 and my browser is IE version 6.0.2800.1106.
My BSP application has two pages: Page-A and Page-B, when I select a item in dropdownListbox in Page-A, I want to pass value to Page-B and display it in a new window.
To do that, I use <b>set_server_cookie</b> in Page-A and <b>get_server_cookie</b> in Page-B.
After I trace in Page-A and Page-B, I found <b>session_id</b> different in two pages.
But when I do not block the cookies in client settings, the <b>session_id</b> are the same in two pages and I got the correct value.
Any idea?
Thank you.
<b>Page-A in OnInputProcessing:</b>
cl_bsp_server_side_cookie=>set_server_cookie(
EXPORTING
name = 'MY_COOKIE'
application_namespace = runtime->application_namespace
application_name = runtime->application_name
username = sy-uname
session_id = runtime->session_id
expiry_time_rel = '600'
data_name = 'test'
data_value = '20041222'
).
<b>Page-B in OnInitialization:</b>
data test_value type string.
cl_bsp_server_side_cookie=>get_server_cookie(
EXPORTING
name = 'MY_COOKIE'
application_namespace = runtime->application_namespace
application_name = runtime->application_name
username = sy-uname
session_id = runtime->session_id
data_name = 'test'
CHANGING
data_value = test_value
).
Are you an SAP Customer? If so you can access the http://service.sap.com and start the message
Our offices are closed till Jan 3th, but I had an answer from OSS. The said to apply note 762645 and 507621. The latter concerns 610 so I wonder if it makes sense to apply at all. The first one should be fixed also with 620 SP44 or 640 SP9. What version of WAS do you have and which SP level? I need to check ours next week.
I have some doubts though on this answer and wondering waht this has to do with blocked client cookies. I've put this doubt as a question to OSS.
Hi Eason,
I got a clarification from the OSS guys. This is what you need to according to them:
"Can you please do the following change:
change session_id = runtime->session_id to
session_id = 'static or session_id = sy-uname
This is because the session_id = runtime->session_id is at the moment a pseudo stable id in the cookie.
This problem shall be solved in the coming SP49."
Can you give it a try Eason? I would go for the sy-uname since the change is very little that a user will use two computers/sessions at the same time.
I'm @home (with my 17 months old daughter on my lap and my 5 year old son asking when he can play on the computer again). I'll give it a try next week.
If you didn't install SP44 yet, it won't hurt to do it anyway.
Happy holidays meanwhile.
Eddy
Hi Eddy,
Thank you a lot for your solution!!!~~~
I use sy-uname as session_id in this condition, and the server side cookie works even if client browser block the cookie.
Here is my code in Page-A and Page-B:
<b>[Page-A]</b>
cl_bsp_server_side_cookie=>set_server_cookie(
EXPORTING
name = 'MY_COOKIE'
application_namespace = runtime->application_namespace
application_name = runtime->application_name
username = sy-uname
session_id = sy-uname
expiry_time_rel = '600'
data_name = 'test'
data_value = '20041222'
).
<b>[Page-B]</b>
data test_value type string.
cl_bsp_server_side_cookie=>get_server_cookie(
EXPORTING
name = 'MY_COOKIE'
application_namespace = runtime->application_namespace
application_name = runtime->application_name
username = sy-uname
session_id = sy-uname
data_name = 'test'
CHANGING
data_value = test_value
).
cl_bsp_server_side_cookie=><b>delete_server_cookie</b>(
EXPORTING
name = 'MY_COOKIE'
application_namespace = runtime->application_namespace
application_name = runtime->application_name
username = sy-uname
session_id = sy-uname
).
Thank you again.
And Happy New Year!!!
Regards,
Eason
Hi Eason,
Did the replies help? If so, don't forget to assign points. I gave them some, but feel free to increase them!
See: /people/mark.finnern/blog/2004/08/10/spread-the-love for directions.
Click on the Yellow Star icon in each reply.
You can give:
1 - 10 pointer (solves problem, marks as answered)
2 - 6 pointers (very helpful)
Lots of 2 pointers (helpful)
Thanks!
Linda (and Mark Finnern)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.