rcdmk / aspJSON

A fast classic ASP JSON parser and encoder for easy JSON manipulation to work with the new JavaScript MV* libraries and frameworks.
MIT License
204 stars 89 forks source link

Remove session dependency #28

Closed japboy closed 7 years ago

japboy commented 7 years ago

This is a request if possible.

Is is possible to remove session dependency so that this library works on a IIS server disabling session feature. I actually don't know what LCID though. Is there any way to avoid relying on session with current version?

Thanks.

rcdmk commented 7 years ago

Hi. LCID is the locale code, that determines the default format for numbers and dates.

It's used here to set the required date and number formats for the JSON standard without requiring users to change their server/app configuration.

If your server/app is configured to use the US international standards, you could remove any session reference from the classes.

I can change this behaviour by making custom formatters, but I don't know if it's worth the work required.

What do you think about this?

japboy commented 7 years ago

My environment is JP, so it should be as it is. And I actually tried to remove actualLCID and session.LCID from the source code and then ASP started returning an error 0x800A0046 Permission denied somehow.

Do you think this error is because the environment is not US international standards?

Thanks.

rcdmk commented 7 years ago

Hi again.

I don't think so.

There must be another point of failure.

Removing this should just have changed the way dates and numbers are outputted on the JSON string.

If you post the error here, I can take a look at it. The error code, message and line will suffice.

japboy commented 7 years ago

Thanks for your help @rcdmk

I just found that the error occurs when JSONarray instance runs class_terminate

set js = new JSONobject fails with error 0x800a0046: https://github.com/rcdmk/aspJSON/blob/master/jsonObject.class.asp#L999

error screenshot: https://gyazo.com/f443fb8e8950734369578f5c6223eb77

this actually didn't occur in my another environment with iisexpress on Windows 10. and this doesn't seem to relate to LCID and session because i could reproduce this error with your original source code and my source code which i removed LCID dependency btw.

do you see any solution to solve this?

thanks again.

rcdmk commented 7 years ago

Hi.

This is a know issue. It just shows up when debugging is enabled.

Clients won't see this error.

I've thought this issue was solved some time ago. I'll reopen it to have it on sight.

19

rcdmk commented 7 years ago

And about the session dependency, I'll add this to the backlog as a feature for the next releases.

japboy commented 7 years ago

Thanks for your concerns!