?
Solved

How to create session Id

Posted on 2011-03-04
14
Medium Priority
?
310 Views
Last Modified: 2012-08-14
Hi ,

How to create session id .  to append the URL ?

i tried with session.getId(); but it return wrong session id.  is there any other way of create session id ?
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 92

Expert Comment

by:objects
ID: 35034328
> How to create session id .  to append the URL ?

Why do you need to append it to the url?
Typically the container looks after that for you.

> i tried with session.getId(); but it return wrong session id.

thats the correct method, where did you get the session object from?
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35035033
>>>>>Why do you need to append it to the url?

For  web services call  i need to apped jsessionID values for authoraztion purpose !

example : https://xxx/Services/Integration;;jsessionid="+session.getId();
>>>>>thats the correct method, where did you get the session object from?
In particular java class

i check request.getSession(true) then i get that value !
0
 
LVL 92

Accepted Solution

by:
objects earned 1000 total points
ID: 35035046
that all sounds fine. what makes you think its the wrong id?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35035067

> Whn i try to call my web services i got following error

ErrorMessage:Internal Error: Session is not available. Aborting.
0
 
LVL 92

Expert Comment

by:objects
ID: 35035095
you need to check the url and see exactly what you are passing, and check if that matches what the web service is expecting.
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35035139
Ya thats correct only . URL is correct .the same thing done by other vendor my client thats working fine .

is session digit is diffrent from each IDE ?
0
 
LVL 92

Expert Comment

by:objects
ID: 35035182
the session comes from the request, has nothing to with the ide
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35035223
Is there any other way to generate session id ??
0
 
LVL 92

Expert Comment

by:objects
ID: 35035925
no, wouldn't make sense to be as they are directly associated with the request. You cannot have a session without a request.
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35036095
what about geting deatils from cokkies ?
0
 
LVL 92

Expert Comment

by:objects
ID: 35036255
cookies from where, what response are you dealing with.
What exactly are you trying to get the session id of?

If you're calling a web service then it should be providing you with a session id (in the initial response most likely)
0
 
LVL 20

Author Comment

by:Sathish David Kumar N
ID: 35036407
i want to send session Id for aruthincation purpose !
we not provide user id and password !
0
 
LVL 92

Expert Comment

by:objects
ID: 35040915
then you need to get the session id from whatever is authenticating you
0
 
LVL 20

Author Closing Comment

by:Sathish David Kumar N
ID: 35082279
I misunderstand the concept . spening time for this question i have the mark
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question