Support For Cookies in MQX 3.8?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Support For Cookies in MQX 3.8?

459件の閲覧回数
Tim562
Senior Contributor I

Hi All,

 

    Does anyone know if there is any support for browser cookies in MQX 3.8? I need some way to secure web pages served by the MQX http server on my device. Once I've prompted a client to enter a username/password (and validated it) I would like to store that info in a cookie that the browser would supply along with it's page requests (no cookie info they get the login page). I make extensive use of MQX's cgi abilities and I wonder if some cgi function call could be executed to read the cookie info (or detect the lack of it)?  Maybe I'm completely off base here and there's some other, better, way to do this? Thanks in advance for any advice or helpfull suggestions.

 

~Tim

ラベル(1)
タグ(1)
0 件の賞賛
1 返信

280件の閲覧回数
dspNeil
Contributor III

Hello Tim.

Yes, you can use cookies with MQX. It really has nothing to do with MQX though. I use a Javascript function to store the cookies, and then one to retrive the cookies. On a page load, I call "getCookie()" for each of the variables that I want restored from the web browser's cookie store, and when necessary, I call "setCookie()" to store them off in the browser. Once you've restored the cookies to a Javascript variable, then you could push that value to a hidden form field, or append the values in your html request string to send it to your MQX functions for parsing.

 

I use the exact functions from this page: http://www.w3schools.com/js/js_cookies.asp

 

Good luck,

Neil