SessionState Sorunu

118 views
Skip to first unread message

Bayram Akbuz

unread,
May 12, 2017, 9:00:33 AM5/12/17
to altdotnetturkiye
merhaba

Bir e-ticaret uygulamasının ödeme adımında SessionState sorunu yaşamaktayım.

Müşteri ödeme ekranında Kredi Kartı bilgileri girdikten sonra ÖDEME YAP düğmesine tıklayarak bilgileri Sanal Pos'a iletmekte ve Sanal Pos'tan ödeme sonucuna bizim tarafımızdan belirtilen adrese yeniden yönlendirmektedir. 

Örneğin;
Ödeme başarılı ise: http://abc.com.tr/ödeme-basarili
Ödeme başarılı ise: http://abc.com.tr/ödeme-basarisiz


Sorun ise tam olarak şu: Başarısız işlemde banka tarafından yönlendirilen adrese geldiğinde kimi zaman müşterinin oturum bilgisi boş geliyor. Yaklaşık olarak kredi kartı ödemelerinin %15'i böyle çalışmakta. 

Aptalca bir yöntem deneyerek ilgili action'da session durumunu denetledim ve boş ise cookie bilgilerinden oturum açtırmak istediğimde de çalışmamaktadır. (Evet, tam olarak bunu yaptım)

Hata oluştuğunda ise adres çubuğundan ana sayfaya gittiğimde herhangi bir sorun yaşanmamaktadır. Müşteri oturumu aktif görünmekte :(


Bu sorunla daha önce karşılaşan var mı? 
Yardımcı olabilir misiniz?
Teşekkürler.



web.config

  <system.webServer>
    <modules>
      <remove name="Session" />
      <add name="Session" type="System.Web.SessionState.SessionStateModule" />
    </modules>
  </system.webServer>


public ActionResult Fail(VirtualPosResponse response)
{
     // bu satıra gelince kimi zaman müşterinin oturum bilgisi boş gelmekte.
}

Selçuk Itmiş

unread,
May 12, 2017, 9:10:38 AM5/12/17
to altdotnetturkiye
Dostum, post ettiğin fail url nin sonuna ilgili kişiye özel bir token ekle ve o şekilde gönder. Fail bölümüne geldiğinde de kişiyi session dan değil de token dan tanı ve işlemlerine ona göre devam et.  

12 Mayıs 2017 Cuma 16:00:33 UTC+3 tarihinde Bayram Akbuz yazdı:

Bayram Akbuz

unread,
May 12, 2017, 9:13:05 AM5/12/17
to altdotne...@googlegroups.com
Şu sorunu aştıktan sonra ilk yapacağım iş o olacak. Öneriniz için çok teşekkür ederim. 

12 May 2017 16:10 tarihinde "Selçuk Itmiş" <petr...@gmail.com> yazdı:
--
You received this message because you are subscribed to a topic in the Google Groups "altdotnetturkiye" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/altdotnetturkiye/dOAC2bZlDv0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to altdotnetturkiye+unsubscribe@googlegroups.com.
To post to this group, send email to altdotnetturkiye@googlegroups.com.
Visit this group at https://groups.google.com/group/altdotnetturkiye.
For more options, visit https://groups.google.com/d/optout.

Selçuk Itmiş

unread,
May 12, 2017, 9:14:20 AM5/12/17
to altdotnetturkiye
Rica ederim, kolay gelsin.

12 Mayıs 2017 Cuma 16:13:05 UTC+3 tarihinde Bayram Akbuz yazdı:
To unsubscribe from this group and all its topics, send an email to altdotnetturki...@googlegroups.com.
To post to this group, send email to altdotne...@googlegroups.com.

Onur DEMİREL

unread,
May 12, 2017, 9:45:53 AM5/12/17
to altdotne...@googlegroups.com
Bayram selam,

WebFarm söz konusu mu ? Eğer durum böyleyse Load balancing için
session konfigurasyonu yapılmış mı kontrol etmek gerekir.

12 Mayıs 2017 16:14 tarihinde Selçuk Itmiş <petr...@gmail.com> yazdı:
> You received this message because you are subscribed to the Google Groups
> "altdotnetturkiye" group.
> To unsubscribe from this group and stop receiving emails from it, send an

Bayram Akbuz

unread,
May 12, 2017, 9:53:48 AM5/12/17
to altdotne...@googlegroups.com
Merhaba Onur.

Hayır yok, tek sunucu.

Esen kalın.
Bayram Akbuz

12 Mayıs 2017 16:45 tarihinde Onur DEMİREL <olf...@gmail.com> yazdı:
> email to altdotnetturkiye+unsubscribe@googlegroups.com.
> To post to this group, send email to altdotnetturkiye@googlegroups.com.

> Visit this group at https://groups.google.com/group/altdotnetturkiye.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "altdotnetturkiye" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/altdotnetturkiye/dOAC2bZlDv0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to altdotnetturkiye+unsubscribe@googlegroups.com.
To post to this group, send email to altdotnetturkiye@googlegroups.com.

Murat YUKSEL

unread,
May 12, 2017, 9:57:41 AM5/12/17
to altdotne...@googlegroups.com
selam 

banka tarafına kullanıcıyı gonderırken gondermıs oldugun bilgiyi sana banka tekrar geri doner sen bu bilgiyi bankaya gondermeden once içerisine her kullanıcıda benzersiz olan primerykey ekleyebilirsin ve bankadan sana geri dondugunde yakalama sansın daha fazla olur ki dogrusuda budur 

bu sekılde deneyebilirsin.sorun kalmayacaktır


MCTS,MCPD,MCITP,MCDBA
Murat YÜKSEL 
0542-840-7112


12 Mayıs 2017 16:10 tarihinde Selçuk Itmiş <petr...@gmail.com> yazdı:

--

Bayram Akbuz

unread,
May 12, 2017, 10:11:23 AM5/12/17
to altdotne...@googlegroups.com
Merhaba Murat Bey

Benzer bir durumu yapmak istediğimde işlem başarısız oluyor. Aşağıda ufak bir log kaydı var. müşterinin oturumunu zorla yeniden oluşturmak istememe rağmen sorun devam ediyor. 

Ana sayfaya gittiğimde ise oturum açık, bu hata sadece o action da oluşmakta. Yani bankadan yeniden yönlendirme yapıldığında oluşuyor. 

Satır içi resim 1



Esen kalın.
Bayram Akbuz

12 Mayıs 2017 16:15 tarihinde Murat YUKSEL <mcpdmur...@gmail.com> yazdı:

--
You received this message because you are subscribed to a topic in the Google Groups "altdotnetturkiye" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/altdotnetturkiye/dOAC2bZlDv0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to altdotnetturkiye+unsubscribe@googlegroups.com.

Cem LEGOZ

unread,
May 15, 2017, 2:16:34 PM5/15/17
to altdotnetturkiye
Merhaba,
Session'dan ziyade cookie problemi olma olasılığı daha yüksek duruyor. Network uzerınden request headerlarini incelemenizi öneririm.

Detayını bilemediğim icin, olabilecek senaryolar;
Cookie eğer secure setlenmis ve istek yapılan url http ise, browser bu cookieyi gondermeyecektir. Diğer bir senaryo ise ödeme veya sonuç sayfanız iframe içinde ise ie gibi browserler, cookieyi kabul etmeyecektir.

Su anki bilgilerle ancak farazi konuşabiliyoruz. Detaylı bir akışı paylaşırsanız daha anlamlı olacaktır.

Tarik Kranda

unread,
May 16, 2017, 4:19:36 PM5/16/17
to altdotne...@googlegroups.com
Merhaba,

Banka çağrılarından vs pek anlamam ama yanıtlarınıza bakınca kıllandığım tek bir nokta var. Özellikle oturumların %15 lik kısmında sessiona erişemiyor olmanızdan.

Tek sunucunuz var olabilir ancak  eğer IIS altında multiple worker process yaratmaya izin verilmişse yani web Garden enabled durumda ise herhangi bir t anında birden fazla worker processes sahip olabilirsiniz.

Bu da şu anlama geliyor; eğer session state saklama modunuz InProc mod olarak ayarlıysa by default, bu durumda bankadan geriye dönen çağrılar açık sessionın ilişkili olduğu worker process yerine diğer worker processin pipe ına düşüyor olabilir. Bu durumda session a ulaşamazsınız. Çağrının yapısını tam kavrayamadım ama mümkün gibi geldi. Sunucunuzun session state modunu InProc'tan StateServer a çekerek tüma ktif worker processlerin aynı havuza bakmasını sağlamanızı tavsiye ederim.






15 Mayıs 2017 21:16 tarihinde Cem LEGOZ <lego...@gmail.com> yazdı:

Bayram Akbuz

unread,
May 16, 2017, 5:01:25 PM5/16/17
to altdotne...@googlegroups.com
Selçuk Bey'in önerdiği gibi dönüştürmüş bulunuyorum. Artık cookie'den okumuyor yani. 

iFrame konusunda kesinlikle haklısınız. Zaten en baştan başlarken o seçeneği elemiştik.



Esen kalın.
Bayram Akbuz

15 Mayıs 2017 21:16 tarihinde Cem LEGOZ <lego...@gmail.com> yazdı:
Merhaba,

Bayram Akbuz

unread,
May 16, 2017, 5:14:24 PM5/16/17
to altdotne...@googlegroups.com
Merhaba Tarık Bey

IIS yapılandırmasında Maximum Worker Process değeri 1 olarak kayıtlı.

SessionState modu ise StateServer olarak saklanmakta. 

Çok ilginç bir hata olduğunu kabul etmekle birlikte internet üzerinde de bir kaynak bulabilmiş değilim.



Esen kalın.
Bayram Akbuz

16 Mayıs 2017 23:19 tarihinde Tarik Kranda <tarik...@gmail.com> yazdı:

--
You received this message because you are subscribed to a topic in the Google Groups "altdotnetturkiye" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/altdotnetturkiye/dOAC2bZlDv0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to altdotnetturkiye+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages