Solved

How to create session Id

Posted on 2011-03-04
14
302 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 500 total points
ID: 35035046
that all sounds fine. what makes you think its the wrong id?
0
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now