0

I created asp.net site. Everything goes well when I am browsing the site on my desktop. But when I open my site on my Iphone - Chrome browser, every request seems to start a new session. I am using the Session.SessionId as associate to shopping cart. But its useles when I get new session on every request...

What I am missing?

New info: I tested one think... when I set sessionState cookieless="true" then it work on my mobile phone. BUT it ruins my URLs! So it seems to be problem with cookies. Is there another way to identify people? I am using SessionId as a shopping cart identificator.

DefinitionHigh
  • 164
  • 1
  • 3
  • 14
  • Where is the site hosted? In local IIS on your desktop? How does your iPhone connect to the web server? Can you share some code? – Faruq Mar 02 '18 at 03:40
  • Hi, website is hosted in hosting provider. New info: I tested one think... when I set sessionState cookieless="true" then it work on my mobile phone. BUT it ruins my URLs. So it seems to be problem with cookies. Is there another way to identify people? I am using SessionId as a shopping cart identificator. – DefinitionHigh Mar 02 '18 at 10:09

2 Answers2

0

see your web.config, maybe session colsed, like


    <sessionState mode="Off"/>

youbl
  • 134
  • 1
  • 11
0

SOLVED. Big thanks to Claudio Redi! I found solution here

When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session ID is generated for each page request until the session object is accessed. If your application requires a static session ID for the entire session, you can either implement the Session_Start method in the application's Global.asax file and store data in the Session object to fix the session ID, or you can use code in another part of your application to explicitly store data in the Session object.

And thank to all who tried to help me :) Have a nice day!

Community
  • 1
  • 1
DefinitionHigh
  • 164
  • 1
  • 3
  • 14