Моё меню Общее меню Сообщество Правила форума Все прочитано
Вернуться   uForum.uz > ИКТ и телеком > IT-индустрия > Софт > Программирование > Веб программирование
Сообщения за день Поиск
Знаете ли Вы, что ...
...для каждой темы существует свой раздел. Изучите структуру форума. Если соответствующего раздела нет, то всегда есть раздел "Разное" :)
<< Предыдущий совет - Случайный совет - Следующий совет >>

Веб программирование Вопросы WEB программирования (Java Script и т.д.)


Ответить

 
Опции темы Опции просмотра
Старый 20.03.2009 09:16   #11  
Real ID Group
Аватар для Artur Alikulov
Оффлайн
Sharifa.Com
Сообщений: 717
+ 386  331/172
– 8  3/1

UzbekistanОтправить сообщение для Artur Alikulov с помощью ICQОтправить сообщение для Artur Alikulov с помощью Skype™LiveJournalМой КругАккаунт на Twitter
Цитата:
Сообщение от elf Посмотреть сообщение
Куки и сессия еще в моде, я тоже планирую решить задачу с ними. Проблема в том, что если сайт music.site.com на другом серваке, тогда он не сможеть получить куки сайта site.com. Или не так? Я еще не проверил. Можеть система позволяеть поддоменным сайтам получить куки их "родителей", хотя они другом серваке?
Куки создаются на стороне клиента и не важно на каких серваках будут находиться сайты.
__________________
Arguing on the internet is like running in the Special Olympics. Even if you win, you're still retarded.
Ответить 
Старый 20.03.2009 10:27   #12  
Open ID Group uParty Member
Аватар для Timur Naimov
Оффлайн
Сообщений: 412
+ 62  206/121
– 0  0/0

UzbekistanОтправить сообщение для Timur Naimov с помощью ICQОтправить сообщение для Timur Naimov с помощью YahooОтправить сообщение для Timur Naimov с помощью Skype™
Цитата:
Сообщение от Artur Alikulov Посмотреть сообщение
Куки создаются на стороне клиента и не важно на каких серваках будут находиться сайты.
Маленькое уточнение из MSDN

Цитата:
Limiting Cookies to a Folder or Application
To limit cookies to a folder on the server, set the cookie's Path property, as in the following example:

Visual Basic Copy Code
Dim appCookie As New HttpCookie("AppCookie")
appCookie.Value = "written " & DateTime.Now.ToString()
appCookie.Expires = DateTime.Now.AddDays(1)
appCookie.Path = "/Application1"
Response.Cookies.Add(appCookie)

C# Copy Code
HttpCookie appCookie = new HttpCookie("AppCookie");
appCookie.Value = "written " + DateTime.Now.ToString();
appCookie.Expires = DateTime.Now.AddDays(1);
appCookie.Path = "/Application1";
Response.Cookies.Add(appCookie);

Note:
You can also write cookies by adding them to the Cookies collection directly as shown in earlier examples.


The path can either be a physical path under the site root or a virtual root. The effect will be that the cookie is available only to pages in the Application1 folder or virtual root. For example, if your site is called www.contoso.com, the cookie created in the previous example will be available to pages with the path http://www.contoso.com/Application1/ and to any pages beneath that folder. However, the cookie will not be available to pages in other applications such as http://www.contoso.com/Application2/ or just http://www.contoso.com/.

Note:
In some browsers, the path is case sensitive. You cannot control how users type URLs into their browsers, but if your application depends on cookies tied to a specific path, be sure that the URLs in any hyperlinks you create match the case of the Path property value.


Limiting Cookie Domain Scope
By default, cookies are associated with a specific domain. For example, if your site is www.contoso.com, the cookies you write are sent to the server when users request any page from that site. (This might not include cookies with a specific path value.) If your site has subdomains—for example, contoso.com, sales.contoso.com, and support.contoso.com—then you can associate cookies with a specific subdomain. To do so, set the cookie's Domain property, as in this example:

Visual Basic Copy Code
Response.Cookies("domain").Value = DateTime.Now.ToString()
Response.Cookies("domain").Expires = DateTime.Now.AddDays(1)
Response.Cookies("domain").Domain = "support.contoso.com"

C# Copy Code
Response.Cookies["domain"].Value = DateTime.Now.ToString();
Response.Cookies["domain"].Expires = DateTime.Now.AddDays(1);
Response.Cookies["domain"].Domain = "support.contoso.com";


When the domain is set in this way, the cookie will be available only to pages in the specified subdomain. You can also use the Domain property to create a cookie that can be shared among multiple subdomains, as shown in the following example:

Visual Basic Copy Code
Response.Cookies("domain").Value = DateTime.Now.ToString()
Response.Cookies("domain").Expires = DateTime.Now.AddDays(1)
Response.Cookies("domain").Domain = "contoso.com"

C# Copy Code
Response.Cookies["domain"].Value = DateTime.Now.ToString();
Response.Cookies["domain"].Expires = DateTime.Now.AddDays(1);
Response.Cookies["domain"].Domain = "contoso.com";


The cookie will then be available to the primary domain as well as to sales.contoso.com and support.contoso.com domains.

Ответить 
"+" от:
Старый 20.03.2009 10:40   #13  
Real ID Group
Аватар для Artur Alikulov
Оффлайн
Sharifa.Com
Сообщений: 717
+ 386  331/172
– 8  3/1

UzbekistanОтправить сообщение для Artur Alikulov с помощью ICQОтправить сообщение для Artur Alikulov с помощью Skype™LiveJournalМой КругАккаунт на Twitter
Цитата:
Сообщение от Timur Naimov Посмотреть сообщение
Маленькое уточнение из MSDN
Не пугай топикстартера MSDN'ом Он на ПХП пишет, хотя и там уверен есть возможность ограничения использования куков субдоменами и т.д.
__________________
Arguing on the internet is like running in the Special Olympics. Even if you win, you're still retarded.
Ответить 
"+" от:
Старый 20.03.2009 11:09   #14  
Open ID Group uParty Member
Аватар для Timur Naimov
Оффлайн
Сообщений: 412
+ 62  206/121
– 0  0/0

UzbekistanОтправить сообщение для Timur Naimov с помощью ICQОтправить сообщение для Timur Naimov с помощью YahooОтправить сообщение для Timur Naimov с помощью Skype™
Цитата:
Сообщение от Artur Alikulov Посмотреть сообщение
Не пугай топикстартера MSDN'ом Он на ПХП пишет, хотя и там уверен есть возможность ограничения использования куков субдоменами и т.д.
Это я к тому, что надо пользоваться "правильными" технологиями (сейчас тапками закидают...)
Ответить 
Реклама и уведомления
Старый 20.03.2009 12:10   #15  
uParty Member Known ID Group
Аватар для DarkUser
Оффлайн
Служу Его Божественной Тени!
Сообщений: 1,671
+ 4,505  1,372/657
– 164  33/27

Uzbekistan
Оффтоп:
Цитата:
Сообщение от Timur Naimov Посмотреть сообщение
Это я к тому, что надо пользоваться "правильными" технологиями
в IT среде принято сначала мозгами пользоваться, а потом уже технологиями
__________________
Are you my mommy?
Ответить 
Старый 20.03.2009 13:24   #16  
Аватар для elf
Оффлайн
Сообщений: 74
+ 5  2/2
– 0  0/0

UzbekistanОтправить сообщение для elf с помощью Skype™
Цитата:
Сообщение от Artur Alikulov Посмотреть сообщение
Цитата:
Сообщение от elf Посмотреть сообщение
Куки и сессия еще в моде, я тоже планирую решить задачу с ними. Проблема в том, что если сайт music.site.com на другом серваке, тогда он не сможеть получить куки сайта site.com. Или не так? Я еще не проверил. Можеть система позволяеть поддоменным сайтам получить куки их "родителей", хотя они другом серваке?
Куки создаются на стороне клиента и не важно на каких серваках будут находиться сайты.
Итак, Вы предлаете создать куки с ограничениями домена (конечно данные храниться в зашифрованном виде). То есть куку установим в виде
setcookie("name", $value, "", ".site.com");
Лишь этого достаточно? И как будет по мере безопасности?
Ответить 
Ответить




Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Advertisement System V2.5 By Branden
OOO «Единый интегратор UZINFOCOM»


Новые 24 часа Кто на форуме Новички Поиск Кабинет Все прочитано Вверх