Discussion:
Session Cookies
Gino Pacitti
2018-10-06 20:22:53 UTC
Permalink
Hi Anyone

I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.

I need to have the session ID and Instance number to be returned and set on the browser… Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?

The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...

Thanks in advance

Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-***@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/uoh8%40ml-in.narkive.net

This email sent to ***@ml-in.nar
Jesse Tayler
2018-10-06 20:27:36 UTC
Permalink
I have no idea what you’re really asking here, but you need to put data into hidden text fields if you want to take those values from the request
Post by Gino Pacitti
Hi Anyone
I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.
I need to have the session ID and Instance number to be returned and set on the browser… Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?
The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...
Thanks in advance
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-***@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/uoh8%40ml-in.narkive.net

This email
Gino Pacitti
2018-10-06 20:35:07 UTC
Permalink
Well thanks… Jesse

Unfortunately I am returning a JSON response and so I need something that is actually going to give me back a new session ID and the correct Instance ID so that the browser sets them from that response.

Thanks anyway…

Gino
Post by Jesse Tayler
I have no idea what you’re really asking here, but you need to put data into hidden text fields if you want to take those values from the request
Post by Gino Pacitti
Hi Anyone
I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.
I need to have the session ID and Instance number to be returned and set on the browser… Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?
The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...
Thanks in advance
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-***@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/uoh8%40ml-in.narkive.net

Th
Aaron Rosenzweig
2018-10-06 20:55:39 UTC
Permalink
Hi Gino,

Set a path of “/“ for your cookies. Make sure it is available to all within the same top level domain.

You might consider JWT (JSON web tokens) to jump back and forth with your staticly served but dynamic javascript app.


AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Well thanks
 Jesse
Unfortunately I am returning a JSON response and so I need something that is actually going to give me back a new session ID and the correct Instance ID so that the browser sets them from that response.
Thanks anyway

Gino
I have no idea what you’re really asking here, but you need to put data into hidden text fields if you want to take those values from the request
Post by Gino Pacitti
Hi Anyone
I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.
I need to have the session ID and Instance number to be returned and set on the browser
 Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?
The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...
Thanks in advance
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com
Gino Pacitti
2018-10-06 20:57:57 UTC
Permalink
Yes I have the path set already but there was no automatic creation of the session cookie. I do have the session flags set for cookie session ID and in the Direct action accessing the session. So the session is being created but no sessionID returned in the headers?

I will look at the JWT stuff though


Gino
Post by Aaron Rosenzweig
Hi Gino,
Set a path of “/“ for your cookies. Make sure it is available to all within the same top level domain.
You might consider JWT (JSON web tokens) to jump back and forth with your staticly served but dynamic javascript app.
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Well thanks
 Jesse
Unfortunately I am returning a JSON response and so I need something that is actually going to give me back a new session ID and the correct Instance ID so that the browser sets them from that response.
Thanks anyway

Gino
I have no idea what you’re really asking here, but you need to put data into hidden text fields if you want to take those values from the request
Post by Gino Pacitti
Hi Anyone
I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.
I need to have the session ID and Instance number to be returned and set on the browser
 Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?
The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...
Thanks in advance
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com <https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
Aaron Rosenzweig
2018-10-06 21:04:59 UTC
Permalink
Hi Gino,

Ah, I got a better idea of what you are driving at.

Your first question is why don’t you see the automatic cookie that WO should provide? Well if typically you do have it but just not with this direct action
 perhaps the direct action is session-less! maybe it never made a session!

Now
 about the JWT
 we go session-less (on purpose) because we don’t want the user locked into a particular app instance. With JWT you have more flexibility and can be session less. You can also put some things in the payload of the JWT.
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Post by Gino Pacitti
Yes I have the path set already but there was no automatic creation of the session cookie. I do have the session flags set for cookie session ID and in the Direct action accessing the session. So the session is being created but no sessionID returned in the headers?
I will look at the JWT stuff though

Gino
Post by Aaron Rosenzweig
Hi Gino,
Set a path of “/“ for your cookies. Make sure it is available to all within the same top level domain.
You might consider JWT (JSON web tokens) to jump back and forth with your staticly served but dynamic javascript app.
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Well thanks
 Jesse
Unfortunately I am returning a JSON response and so I need something that is actually going to give me back a new session ID and the correct Instance ID so that the browser sets them from that response.
Thanks anyway

Gino
I have no idea what you’re really asking here, but you need to put data into hidden text fields if you want to take those values from the request
Post by Gino Pacitti
Hi Anyone
I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.
I need to have the session ID and Instance number to be returned and set on the browser
 Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?
The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...
Thanks in advance
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com <https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com
Gino Pacitti
2018-10-06 21:12:32 UTC
Permalink
Yes there was no automatic session wosid being returned even though I was accessing and creating the session in the direct action method.

I’m aware its because I am creating the WOResponse manually


I therefore seem to be avoiding the apps response auto mechanism which adds the cookies to the header. And because of that I think I just need to know how I can nudge WO and get the one of the values, the woinst

I know how to get the wosid but not the woinst - I think that is from the Adaptor so Im not sure how to access that to supply manually.

Gino
Post by Aaron Rosenzweig
Hi Gino,
Ah, I got a better idea of what you are driving at.
Your first question is why don’t you see the automatic cookie that WO should provide? Well if typically you do have it but just not with this direct action
 perhaps the direct action is session-less! maybe it never made a session!
Now
 about the JWT
 we go session-less (on purpose) because we don’t want the user locked into a particular app instance. With JWT you have more flexibility and can be session less. You can also put some things in the payload of the JWT.
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Post by Gino Pacitti
Yes I have the path set already but there was no automatic creation of the session cookie. I do have the session flags set for cookie session ID and in the Direct action accessing the session. So the session is being created but no sessionID returned in the headers?
I will look at the JWT stuff though

Gino
Post by Aaron Rosenzweig
Hi Gino,
Set a path of “/“ for your cookies. Make sure it is available to all within the same top level domain.
You might consider JWT (JSON web tokens) to jump back and forth with your staticly served but dynamic javascript app.
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Well thanks
 Jesse
Unfortunately I am returning a JSON response and so I need something that is actually going to give me back a new session ID and the correct Instance ID so that the browser sets them from that response.
Thanks anyway

Gino
I have no idea what you’re really asking here, but you need to put data into hidden text fields if you want to take those values from the request
Post by Gino Pacitti
Hi Anyone
I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.
I need to have the session ID and Instance number to be returned and set on the browser
 Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?
The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...
Thanks in advance
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com <https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
Gino Pacitti
2018-10-06 21:25:54 UTC
Permalink
Solved


I just piggy backed on the current response and all is now as it should be


Thanks for feedback everyone.

Gino
Post by Gino Pacitti
Yes there was no automatic session wosid being returned even though I was accessing and creating the session in the direct action method.
I’m aware its because I am creating the WOResponse manually

I therefore seem to be avoiding the apps response auto mechanism which adds the cookies to the header. And because of that I think I just need to know how I can nudge WO and get the one of the values, the woinst
I know how to get the wosid but not the woinst - I think that is from the Adaptor so Im not sure how to access that to supply manually.
Gino
Post by Aaron Rosenzweig
Hi Gino,
Ah, I got a better idea of what you are driving at.
Your first question is why don’t you see the automatic cookie that WO should provide? Well if typically you do have it but just not with this direct action
 perhaps the direct action is session-less! maybe it never made a session!
Now
 about the JWT
 we go session-less (on purpose) because we don’t want the user locked into a particular app instance. With JWT you have more flexibility and can be session less. You can also put some things in the payload of the JWT.
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Post by Gino Pacitti
Yes I have the path set already but there was no automatic creation of the session cookie. I do have the session flags set for cookie session ID and in the Direct action accessing the session. So the session is being created but no sessionID returned in the headers?
I will look at the JWT stuff though

Gino
Post by Aaron Rosenzweig
Hi Gino,
Set a path of “/“ for your cookies. Make sure it is available to all within the same top level domain.
You might consider JWT (JSON web tokens) to jump back and forth with your staticly served but dynamic javascript app.
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
Well thanks
 Jesse
Unfortunately I am returning a JSON response and so I need something that is actually going to give me back a new session ID and the correct Instance ID so that the browser sets them from that response.
Thanks anyway

Gino
I have no idea what you’re really asking here, but you need to put data into hidden text fields if you want to take those values from the request
Post by Gino Pacitti
Hi Anyone
I’m working on an app that needs a javascript fetch to set a value in the session but it is coming from a static HTML page outside the app.
I need to have the session ID and Instance number to be returned and set on the browser
 Is there a method I can call in my DirectAction that will set the headers in the AJAX response so the client will have them for the next request I make from that browser window?
The current set up creates a new WOResponse where I am setting headers but I do not just want to manually create the cookie...
Thanks in advance
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com <https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/ginokris%40me.com
Loading...