RejectedSoftware Forums

Sign up

Use session data inside of a REST interface?

I'm new to web development, so keep in mind I might not know exactly what I'm doing ;)

I'm writing a web site with vibed and registerWebInterface and got authentication done similar to the documentation using URLRouter and a SessionVar.

Now I want to add some Ajax and thought that registerRESTInterface would be up to the task. Is there any way to access the current session inside a method of my REST interface?

Re: Use session data inside of a REST interface?

found this. I think that helps.

Re: Use session data inside of a REST interface?

On Wed, 03 Dec 2014 07:59:48 GMT, Tobias Pankrath wrote:

found this. I think that helps.

Yeah it's probably what you're looking for.
However, I would not recommend mixing REST interface and Web interface (I doubt it's an higly tested scenario).

Could you describe a bit more of your use case ?

Re: Use session data inside of a REST interface?

On Fri, 05 Dec 2014 08:07:06 GMT, Mathias LANG wrote:

On Wed, 03 Dec 2014 07:59:48 GMT, Tobias Pankrath wrote:

found this. I think that helps.

Yeah it's probably what you're looking for.
However, I would not recommend mixing REST interface and Web interface (I doubt it's an higly tested scenario).

Could you describe a bit more of your use case ?

I'm just writing a web app that should retrieve some JSON via AJAX. I didn't knew that you can have HTTPServerRequest and HTTPServerResponse as parameters for web interface methods, they solve all my problems :)