How to create session Id

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 ?
LVL 20
Sathish David  Kumar NArchitectAsked:
Who is Participating?
 
objectsCommented:
that all sounds fine. what makes you think its the wrong id?
0
 
objectsCommented:
> 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
 
Sathish David Kumar NArchitectAuthor Commented:
>>>>>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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
Sathish David Kumar NArchitectAuthor Commented:

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

ErrorMessage:Internal Error: Session is not available. Aborting.
0
 
objectsCommented:
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
 
Sathish David Kumar NArchitectAuthor Commented:
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
 
objectsCommented:
the session comes from the request, has nothing to with the ide
0
 
Sathish David Kumar NArchitectAuthor Commented:
Is there any other way to generate session id ??
0
 
objectsCommented:
no, wouldn't make sense to be as they are directly associated with the request. You cannot have a session without a request.
0
 
Sathish David Kumar NArchitectAuthor Commented:
what about geting deatils from cokkies ?
0
 
objectsCommented:
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
 
Sathish David Kumar NArchitectAuthor Commented:
i want to send session Id for aruthincation purpose !
we not provide user id and password !
0
 
objectsCommented:
then you need to get the session id from whatever is authenticating you
0
 
Sathish David Kumar NArchitectAuthor Commented:
I misunderstand the concept . spening time for this question i have the mark
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.