0

I am looking for a simple way to pass a session id from android(java) to php. The session id should be "used" automatically and I can access the session data via php. Like $var = $_SESSION['username'];

I found this out (https://stackoverflow.com/a/21271347/10089811):

DefaultHttpClient httpclient = new DefaultHttpClient();

CookieStore cookieStore = new BasicCookieStore();
httpclient.setCookieStore(cookieStore);

HttpStack httpStack = new HttpClientStack(httpclient);
RequestQueue requestQueue = Volley.newRequestQueue(context, httpStack);

But the session id is not set. Is there a way to set the session id to this cookieStore? I also looked at this post but it didn't worked for me and it's not the elegant way I am looking for.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
Jakob
  • 1,858
  • 2
  • 15
  • 26
  • I think you haven't read the whole answer there; please read again. – Martin Zeitler Apr 03 '20 at 03:14
  • @MartinZeitler I read it. I want to know how and where to implement my session_id string. – Jakob Apr 03 '20 at 03:25
  • It is pretty obvious that you've only read the upper half of it, based upon the code example... and at least one of the other linked posts answers your question accurately. While I'm sure I could continue searching and add a few more duplicates. Just use `CookieManager`. – Martin Zeitler Apr 03 '20 at 03:39
  • @MartinZeitler Yeah. But where do I have to add my session id? And I read all the posts and tried them. – Jakob Apr 03 '20 at 04:05

0 Answers0