?
Solved

How to create session Id

Posted on 2011-03-04
14
Medium Priority
?
311 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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month15 days, 1 hour left to enroll

840 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