sessionStorage

Hi folks,

I’m experiencing a strange issue with using the sessionStorage plugin. In my handler I use DI to inject the plugin like so:

/** Inject the ColdBox SessionStorage Plugin */
property name=“sessionService” inject=‘coldbox:plugin:SessionStorage’;

I then set some session variables in my handler:

sessionService.setVar(“userid”,rc.user.getUserID());

Within the view of that handler I can view the session variable, however when I browse to a different handler/view the session variable does not exist.

It seems like the session variables get blown away after a new request is started. Has anyone else ever experience this?

Thanks.

Nolan

Hi, Nolan:

I ran into this before, but I don’t totally remember why. One thing I would do is dump the cookies (URL ?dumpvar=cookie) and make sure the CFToken does not change from one request to another, as this would create a new session.

Kevin

Also, please double check your application.cfc settings. this.setClientCookies should be true to tell ColdFusion to maintain the session via a client cookie.

Thanks,

Aaron

That fixed it.

Thanks very much Aaron.

Nolan