cancel
Showing results for 
Search instead for 
Did you mean: 

Session and Cookie in Portal

Former Member
0 Kudos

Hi experts,

Can anyone explain the session and cookie concept for me and guide me how to config the session or cookie in EP?

Thanks in advance.

Regards,

Chris gu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

closed.

Thanks.

Former Member
0 Kudos

Which cookie? There is a logon ticket, held as a cookie. There is a session cookie, which tells the Java dispatcher which server process to send a user to and if you're using SAP Web Dispatche there's a cookie which tells Web Dispatcher which Java dispatcher to use.

After that there could be application specific cookies...

Former Member
0 Kudos

Hi,

I have no idea about that and I am a little confused.

Can you tell me the difference between these three cookies and the detail information about that?

Thanks.

Regards,

Chris Gu

Former Member
0 Kudos

I've explained the difference! Why do you want to know? You shouldn't really care unless you're doing some low level problem solving.

Former Member
0 Kudos

Hi,

Thanks for your quick reply.

Since there are three different cookies, how to know which cookie I should choose for a particular application?

I have another question: do we need to write code for cookie?

Regards,

Chris Gu

Former Member
0 Kudos

You shouldn't use any of the SAP supplied cookies. Instead, create your own and put whatever values you want in there. Yes, you need to write your own code to create and check cookie contents.

Former Member
0 Kudos

Hi,

Thanks again.

Another question:

Since I can create new cookie, how to create it ? Do I need to write abap code or java code?

Regards,

Chris

Former Member
0 Kudos

Let's go back a step... What are you going to use the cookie for? Cookies are sent to the browser by a web application and are read by the same or another web application. So, you need to know what language you;re writing your web app in...

Former Member
0 Kudos

Hi,

I am doing some research on EP session and cookie . I am not familar with that. So I want to know about that.I know ABAP and Java language both can be used. But I want some sample code to get more detail.

Can you help me?

Regards,

Chris

Former Member
0 Kudos

But the cookies are just cookies! You can read them with any language, so I'm not sure what code you want. If you use HTTPwatch (or similar) you should be able to see the cookies arriving at the browser.

Former Member
0 Kudos

Hi,

Thanks all the same.

Maybe I make you a little confused. Sorry for that.

I myself is not familar, so some words I explain are not correct enough.

For cookie, you say I can write it. Then I make the proble easy, can you tell me how to create cookie using java language?

Regards,

Chris Gu

Former Member
0 Kudos

I used Google to find [this site|http://www.java2s.com/Tutorial/Java/0360__JSP/CreateCookie.htm] which included the following code:


<HTML>
    <HEAD>
        <TITLE>Reading a Cookie</TITLE>
    </HEAD>  

    <BODY>
        <H1>Reading a Cookie</H1>  
  
        <%
        Cookie cookie1 = new Cookie("message", "Hello!");
        cookie1.setMaxAge(24 * 60 * 60);
        response.addCookie(cookie1); 
        %> 
        <P>refresh to see the Cookie</p> 
        <%
        Cookie[] cookies = request.getCookies();
    
        for(int i = 0; i < cookies.length; i++) { 
            if (cookies<i>.getName().equals("message")) {
                out.println("The cookie says " + cookies<i>.getValue());
            }
        }  
        %>
    </BODY>  
</HTML>

Former Member
0 Kudos

Hi,

You are so patient. Thanks a lot.

Would you mind if I ask one more question?

For ABAP part, do you konw how to create it?

Regards,

Chris Gu

Former Member
0 Kudos

No. You may want to search/ask in the ABAP forum!