Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by dletozeun 1 · Mar 18, 2011 at 10:11 AM · playerwebcookies

Access browser cookies from Web Player

Assume that the web player is embedded in a web page containing a flash application used to authenticate a user. Once the user is authenticated on the server, this one put a cookie in the user web browser to recognize subsequent http requests from this user. As the web player is part of the application, all the http requests from web player to the server need this cookie to allow the player to acces user data.

So I was wondering if Unity provides something to access browser cookies and get the one corresponding to the server domain? Do I have to do it manually through javascript?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Bunny83 · Mar 18, 2011 at 11:39 AM

Unfortunately Unity don't have such a function. If you're logged in via your website you would have to use Application.ExternalEval. Even if you use WWW to log in from your Unity app you have to parse the response header for the SetCookie header field.

Also watch out: The Unity WWW.responseHeaders (which are not documented yet) is a Hashtable! If your webserver returns multiple SetCookie header fields (which is legit by rfc2616 ) you will loose them except one due to the Hashtable. Hopefully it will be fixed soon ;)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image dletozeun 1 · Mar 21, 2011 at 02:12 PM 0
Share

Thank you Bunny83 for this quick and clear answer! :) I managed to make it work through web browser javascript and ExternalCall like you suggested.

avatar image
0

Answer by GuyTidhar · Jun 19, 2011 at 07:34 AM

Can I set this cookie from the client?

Also since I have the pro version, could I use .NET http classes in a dll to perform all my http connection functionality for the webplayer build?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Games on google sites (Crome) = Install Unity web player!? 1 Answer

Can't get SendMessage in webpage to send info to the web player 1 Answer

Failed to update unity web player. 0 Answers

Unity Web Player 3.0 can not be installed? 1 Answer

web player overlays HTML layers 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges