PHP Setcookie To Resemble ASP Subkeys?
Jun 24, 2010
ASP.Net has the concept of using 'subkeys' in cookies. i.e. You can write a cookie with
Response.Cookies("userInfo")("userName") = "patrick"
Response.Cookies("userInfo")("lastVisit") = "today"
This would create a cookie which looks like
Name: userInfo
Value: userName=patrick:lastVisit=today
Is there a native method in PHP to read/write cookies like the above one? I need to read/write a cookie in PHP which can be read by ASP.Net with subkeys.
View 2 Replies
Mar 31, 2010
I have a datasource with parameters for the SELECT clause and I want to use an asp:CookieParameter but my cookie has several subkeys. For example, the main cookie is named "teres_soft" and the subkey I want to use is "branch_code" so I get this value using a Request.Cookie("teres_soft")("branch_code"). I can easily set such a parameter if my cookie does not have any subkeys but, is it possible to use a cookie's subkey in the SELECT asp:CookieParameter?
View 1 Replies
Dec 20, 2010
I created three web pages: Page1, Page2, Page3. In Page1, two variables(Var1, Var2) were stored by subkeys(Key1, Key2) in a single cookie. After storing, Page1 was redirected to Page2 by Server.Transfer() as the following code:
Response.Cookies("MyCookie")("Key1") = Var1
Response.Cookies("MyCookie")("Key2") = Var2
Server.Transfer("Page2.aspx")
Similarly, I use subkeys(Key3 ~ Key5) to store three variables(Var3 ~ Var5) in Page2 and then redirect to Page3 as the following code:
Response.Cookies("MyCookie")("Key3") = Var3
Response.Cookies("MyCookie")("Key4") = Var4
Response.Cookies("MyCookie")("Key5") = Var5
Server.Transfer("Page3.aspx")
If Cookies("MyCookie") isn't rewritten by other code, it should return Var1 ~ Var5 respectively to execute Request.Cookies("MyCookie")("Key1") ~ Request.Cookies("MyCookie")("Key5") in Page3. However... Strange things happened, Var1 and Var2 were not returned, but empty string are returned instead.
View 10 Replies