mercredi 1 mai 2019

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time Filename: Session/Session.php

  • Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php * Message: session_set_cookie_params(): Cannot change session cookie parameters when headers already sent

All files work normally after uploading but this verify controller give me continuous problems...




How to fix website that crashes Chrome browser

So basically, my website seems to crash chrome or if not, makes it very laggy. I have quite a few keyframe animations (moving to GSAP soon which I think may fix this). Does anyone have any ideas why it could be crashing?

Website is http://www.harrybilney.co.uk

If you wanna view the source, just use inspect.




Accessing header and footer of site

I want to access the header and footer of my site. The site is build on a .net framework. Is there a way to remotely access it?




Let the user send requests instead flask python

I want the user to make a get request to another site to gather data from there, which he will later send as a post request to my flask server. At the moment my flask server does all the data requesting, but I want to replace that.

I have tried making the request in a route, but that didn't help. All requests were done by my server again.

@app.route("/")
def home():
    r = requests.get(url).text
    p = remove_things(r)
    return p

What I want is that the user should make that get request instead of my server.




How to detect technology used in web app?

By using wappalyzer chrome extension, we can detect technologies used on the main page.

But few of the websites like google, facebook, Gmail and Amazon,... won't show up any technologies. Does it mean that they are not using any frontend frameworks or technologies? Or they have their own? In that case, till sometime back facebook was showing React. Now it stopped showing? Are they doing any sort of technical hack to hide the technologies from outsiders?

Is there any other better extension which provides such details? Would love to hear your inputs on this in detail.

For security reasons, if we can also do the same thing, what are the measures to be considered?




How to block user type some characters to input?

I have a web app there is an input user can add some names in it but I don't want user to enter apostrophe ' sign. when user presses the ' sign html don't have to insert the character. I am new with html, also I have the js code file.

<div class="col-md-4">
        <input name="name" type="text"  class="form-control" placeholder="Name">
      </div>




mardi 30 avril 2019

User.Identity.Name returns empty and IIS asks for credentials when API is hosted

User.Identity.Name is empty when hosted on IIS. Also IIS asks for cendentials when IP address is put in URL rather than localhost. Please advise how to fix this.

Windows and Anonymous Authentication is enabled in IIS.

I tried enabling and disabling anonymous authentication in IIS

namespace System.Web.Mvc
{
    public class AccessController : AuthorizeAttribute
    {
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            var isAuthorized = base.AuthorizeCore(httpContext);
            if(!isAuthorized)
            {
                return false;
            }

            return base.AuthorizeCore(httpContext);
        }
    }
}        


My controller
        [System.Web.Http.HttpGet]
        [AccessController]
        [System.Web.Http.Route("api/GetUser")]
        public string GetCurrenTUser()
        {
            if(User.Identity.IsAuthenticated)
            {
                return User.Identity.Name.Replace("EMEA\\", "");
            }

            return "false";

        }

Web.Config

 <system.web>
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" />
    <authentication mode="Windows"/>
  </system.web>